• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Spectrum components show only lightest theme and don't change background color through css

Explorer ,
Jan 24, 2023 Jan 24, 2023

Copy link to clipboard

Copied

sp-textfield sp-picker or sp-dropdown and only partially sp-action-button. Everything works in Photoshop, but strangely enough, UXP runtime for Photoshop seems to be older. Actually, all components look nice, and I can change the background of the dialog to the lightest to make it uniform. But maybe I have the wrong runtime for InDesign? Is there any way to fix that?

userAgent: "Adobe UXP Runtime/uxp-6.5.0-local (win32 10.0.19045; x64) Adobe InDesign/18.1.0 10043/1.0.0"
userAgent: "Adobe UXP Runtime/uxp-6.4.0-3-ec28f9a (win32 10.0.19045; x64) Adobe Photoshop/24.1.1 reallydontcare/0.0.1"

Capture_spectrum_InDesign.JPGCapture_spectrum_photoshop.JPG

I can also check themes by

app.generalPreferences.uiBrightnessPreference

and change styles manually after that, but I can not find how. If I make dropdowns "quiet" it solves the background problem, but I still can not change the text color. Otherwise, it's awesome, and events do function, and it allows you to modify the form in real time. Would be nice to match colors, though.

 

TOPICS
UXP Scripting

Views

79

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

You may want to reach the Adobe Creative Cloud Developer forum: https://forums.creativeclouddeveloper.com/

People there are at the edge of UXP and may bring more suitable answers.

FWIW

Loic

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

Thank you, Loic! But it seems that it's about InDesign implementation, after all.

 

Just noticed that in the Photoshop "document.theme" has "hostThemeCSSStyleSheete.exports" filled with 6 objects like "(prefers-color-scheme: dark)" and document.theme.getCurrent() returns current theme.

 

In InDesign document.theme.getCurrent() returns "light" but only because it's just nulled and 0 is the index for "lightest" ("dark" is 2, "darkest" is 3). "hostThemeCSSStyleSheet: null" does not have any CSS rules in it, but it seems that Spectrum components know how to react to "lightest" anyway. I mean, if only there were a way to set this value, then Spectrum components most likely would honor the color theme.

 

Meanwhile, I made a temporary mix of the "select" and "sp-menu," serving as a dropdown. Because "select" looks right but doesn't open a dropdown, and "sp-menu" is modifiable. It seems that "sp-picker" does basically the same internally. It's slightly less smooth than modifying the ready component, but it works.
I'll keep in mind the Creative Developer forum, though, thanks again.
Olga

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Jan 26, 2023 Jan 26, 2023

Copy link to clipboard

Copied

LATEST

Oh my bad, sorry for the misunderstanding.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines