Skip to main content
Participating Frequently
January 25, 2023
Question

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

  • January 25, 2023
  • 1 reply
  • 575 views

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"

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.

 

This topic has been closed for replies.

1 reply

Loic.Aigon
Legend
January 26, 2023

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

Participating Frequently
January 26, 2023

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

Loic.Aigon
Legend
January 26, 2023

Oh my bad, sorry for the misunderstanding.