Skip to content
BENIBIX Learn

Semantic Token

Design📐 Design StandardsTokens and Themes

Also known as Alias Token, Purpose Token, Decision Token

A token named for its job, like color-danger. It points to a raw value.

Think of it like

It is like a job title. The title says teacher, and the person filling it can change.

Example

color-background points to white in the light theme and to near-black in the dark one. No component changes.

Why it matters

A new theme or a new brand look is then just a change of pointers. Nothing is rewritten.

Definition

A semantic token is a design token named for its job. One might be the color for text, or the color for danger. It points to a primitive token rather than holding a raw value. Parts on the screen use these tokens. For a dark theme, the team points the same tokens at other raw values. Nothing else has to change.

Example code

css
:root { --color-background: var(--white); }
[data-theme="dark"] { --color-background: var(--grey-900); }
The same job name points to a different raw value in each theme.

Common mistake

Making one for each single use. Keep the list short, so people can remember it.

Key takeaways

  1. 1
    Named for the job. Text, danger, surface.
  2. 2
    Points to a primitive. Holds no raw value.
  3. 3
    Makes themes easy. Swap the pointers.

Compare