concept

Semantic token — CSS reference

A semantic token names a purpose instead of a raw palette position. Themes can remap --surface while component declarations remain the same. Contrast and accessibility still require checking actual color pairs.

Formal Syntax & Structure

css syntaxcss
--surface: var(--neutral-100);

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>semantic-token</title><style>body{margin:8px;font:16px/24px sans-serif;color:black;background:white}#a{box-sizing:border-box}:root{--neutral-100:white;--neutral-900:#172033;--surface:var(--neutral-100)}#a{background:var(--surface)}:root.dark{--surface:var(--neutral-900)}</style><body><div id="a">Sample</div></body></html>
CSS Reference