theming

Giving the same components different looks, such as light, dark or a different brand, by swapping the token values they use.

In more detail

Good theming never edits components: it changes which values the semantic tokens point to. On the web this is usually done by redefining CSS custom properties under a selector such as [data-theme="dark"]. Themes can be nested, so one section of a page can use a different theme from the rest.

Example

In the browser: A clean approach sets design tokens as custom properties on :root and swaps them with a data-theme attribute or a prefers-color-scheme media query. Components only reference the tokens, so they follow the theme automatically.

Related terms

Taught in

References