color.theme.text.primary.normal β points at a different
primitive in each theme, so a single component build renders correctly in light,
dark, and high-contrast without any conditional code.--mds-color-theme-* CSS
custom property) and never the primitive.color.theme.text.primary.normal resolves to:color.core.black-alpha.95 | ||
color.core.white-alpha.95 | ||
color.highcontrast.white.WindowTextColor | #000000 | |
color.highcontrast.black.WindowTextColor | #ffffff |
WindowTextColor, WindowColor, ButtonTextColor, HighlightColor,
GrayTextColor, HotlightColorβ¦). For example, in high-contrast light
background.solid.primary.normal β color.highcontrast.white.WindowColor
(#ffffff) and outline.primary.normal β WindowTextColor (#000000); the
dark palette inverts these.packages/assets/tokens/src/:theme/stable/light.json | |
theme/stable/dark.json | |
theme/stable/highcontrast/hc_light.json | |
theme/stable/highcontrast/hc_dark.json | |
aaos/day.json | |
aaos/night.json |
color.highcontrast.* system-color palette for accessibility.color.theme.text/background/button/β¦ groups, it
defines its own smaller set (~39 tokens) under color.theme.surface.* and
color.theme.content.* β for example color.theme.surface.neutral.0.default
(color.core.gray.93 in day), color.theme.content.text.neutral.primary
(#ffffffe0), and color.theme.content.btn.accent.default. Components that
target AAOS consume that namespace directly; the stable usage groups documented
in src/additionaltheme/{light,dark}/:Indigo, Jade, Bronze, Rose, Lavender
--mds-color-theme-* custom properties β for example:.mds-theme-stable-lightWebex.mds-theme-stable-darkWebex.mds-theme-stable-hcLightWebex/.mds-theme-stable-hcDarkWebex.mds-theme-stable-darkIndigoWebex(accent overlay).mds-theme-aaos-day/.mds-theme-aaos-night
packages/assets/tokens/config/tokens/core.json and
config/tokens/additional-themes.json.themeproviderthemeclass attribute), and
every var(--mds-color-theme-*) beneath it resolves to that themeβs values. The
provider currently exposes the stable Webex mode and its brand accents as
runtime-selectable classes; high-contrast and AAOS selectors are emitted by the
build and can be applied the same way.color.theme.inverted.*β the mirror of the active theme (light colors in light mode, dark in dark mode). Use it for surfaces that must contrast against the current theme, such as tooltips and coachmarks.color.theme.common.*β colors that stay the same across every theme. Use these only when a color must not flip with the theme (e.g. partner file colors, media touchbar). Only a few components need common colors.
--mds-color-theme-* property that a given theme does not define,
the custom property is unset and CSS falls back to the inherited/initial value β
which is almost never what you want.Only reference semantic tokens that exist in Color ; do not invent token names.A mode that intentionally omits tokens (as AAOS does) will not provide those properties β components used there must rely only on tokens that mode defines. When you add a token, define it in every mode that component ships to.
Add the source JSON under packages/assets/tokens/src/(a newtheme/stable/<mode>.json, or an accent overlay inadditionaltheme/<light|dark>/<accent>.json).Define every semantic key the target components use, following the same color.theme.<usage>.<variant>.<state>structure as the existing modes.Register a build target (destination + cssSelector+targets) in the relevantconfig/tokens/*.jsonso the mode compiles to its own.mds-theme-*selector.Rebuild the tokens package so the CSS custom properties are emitted. Wire the new selector into themeproviderif it should be runtime-selectable.
Color β the semantic token catalogue these themes resolve.Glass β glass material/blur tokens and how they behave per theme. component (Tier 3) β applying a theme at runtime.themeprovider