semantic token
A token named for its purpose, such as color.action.bg or color.surface, that points at a global token.
In more detail
Semantic tokens are the middle tier of a three-tier hierarchy. Because components use the purpose name rather than the raw colour, a theme such as dark mode only needs to repoint the semantic tokens to different global values. They are the foundation of theme switching.
Related terms
- global token — A token that holds a literal value from the full palette, such as blue.500 = #3b82f6, with no meaning attached.
- component token — A token scoped to one component, such as button.primary.bg, that usually points at a semantic token.
- token alias — A token whose value is a reference to another token, written in curly braces such as {semantic.action.bg}.
- theming — Giving the same components different looks, such as light, dark or a different brand, by swapping the token values they use.
Taught in
- Design Tokens: W3C Specs, Global, Semantic & Component Tokens — Design Systems & Component Engineering
- Dark Mode Strategies: System Preference, Class & High-Contrast — Design Systems & Component Engineering