apps/shade/src/docs/tokens.mdx
import { Meta } from '@storybook/addon-docs/blocks';
<Meta title="Tokens / Tokens Guide" /> <div className="sb-doc">radius-control, radius-surface, radius-pill).md: / lg: variants.Toggle light/dark from the Storybook toolbar to see semantic tokens flip.
Semantic tokens are named by purpose — --background, --text-primary, --border-default, --surface-elevated. They flip between light and dark mode automatically. Reach for these by default.
Raw tokens are concrete values — --color-gray-500, --text-base, --spacing. They never change between modes. Use only when no semantic token fits (chart series, brand assets, illustrations).
apps/shade/theme-variables.css — semantic tokens + dark-mode overrides.apps/shade/tailwind.theme.css — Tailwind @theme block: raw catalogue and bindings.--color-* tokens, not to another semantic token. For example, prefer --text-primary: var(--color-black) over --text-primary: var(--foreground).bg-background, text-foreground, rounded-md — over inline styles.hsl() values for UI chrome. They don't theme and don't dark-mode. Chart tokens are the current exception until the chart palette has its own raw scale.var(--token) directly. Don't wrap variables in color functions.dark: variants for colour. The tokens do that. (Exceptions: assets like logos and illustrations.)