You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now themes provide a text and background color, and other components “attach” their colors to each theme as they need.
This system doesn’t scale well now that we have several components that use themes. Each theme gets larger, and is populated with component-specific design tokens. this also makes it difficult to know where to find the configuration of a component.
Proposal:
Each theme will specify a range of semantically-named colors, selected from the global color palette e.g. --bs-theme-color-dark, --bs-theme-background-color-base, bs-theme-interactive-color-light
each component can then use those colors instead of the colors in the global color palette. Using that component in an element with a different theme will switch the component colors automatically, without configuration on the component level
utility classes should also apply theme colors instead of colors direct from the palette e.g. .u-bg-theme-background-dark. Changing the theme will then automatically change the colors
In future, implementing a dark and/or high-contrast mode will then be a case of changing the theme variables, with no need to edit the components individually.
Example:
(Pseudocode, not checked that this as we want it works yet. Colors are randomly chosen)
Right now themes provide a
text
andbackground
color, and other components “attach” their colors to each theme as they need.This system doesn’t scale well now that we have several components that use themes. Each theme gets larger, and is populated with component-specific design tokens. this also makes it difficult to know where to find the configuration of a component.
Proposal:
--bs-theme-color-dark
,--bs-theme-background-color-base
,bs-theme-interactive-color-light
.u-bg-theme-background-dark
. Changing the theme will then automatically change the colorsExample:
(Pseudocode, not checked that this as we want it works yet. Colors are randomly chosen)
The text was updated successfully, but these errors were encountered: