Full contextual theming#24969
Conversation
|
It looks like your PR has been selected for a highlight in the next release blog post, but you didn't provide a release note. Please review the instructions for writing release notes, then expand or revise the content in the release notes directory to showcase your changes. |
|
I ended up completely re-writing the previous version ("limited contextual theming") but re-used the same PR instead of creating a new one (partially by accident). In any case, I think this is ready for review. @gagnus I'd be interested in your comments; as this moves somewhat nearer to your "slots" idea. I have not attempted to implement an algorithmic theme generator (I'll leave that to you or someone else), I'm just trying to put in the infrastructure for contextual theming and semantic tokens. I have continued to use alpha colors in a few places - this is primarily for ease of migration on my part. There's no longer an "alpha hack" for sliders and text input backgrounds. Alpha is mainly used for disabled controls, because this is the specification given on the figma doc. However, with some effort, the number of alpha colors could be reduced even further if desired (although there are a few things, like focus rects, which depend on alpha). |

Third time's the charm, maybe? This now implements full-on contextual theming.
Token lookup now happens in two stages:
A theme token is converted into a semantic token, and then the combination of semantic token + theme context is used to look up a color. The set of semantic tokens is much smaller than the set of theme tokens.
The theme context is an enum which indicates the surface layer of the container holding the widget.
@alice-i-cecile @gagnus