What Are Design Tokens?
Design tokens are the atoms of your design system — named key-value pairs that represent design decisions. For color, they bridge the gap between raw hex values and semantic meaning.
Three-Tier Token Architecture
**Tier 1 — Primitive tokens** (raw values):
--color-blue-600: #2563eb;
--color-blue-50: #eff6ff;
**Tier 2 — Semantic tokens** (roles):
--color-action: var(--color-blue-600);
--color-action-surface: var(--color-blue-50);
**Tier 3 — Component tokens** (usage):
--button-bg: var(--color-action);
Baking In Accessibility
The key insight is to audit at the semantic tier, not the primitive tier. Instead of "does blue-600 pass on white?", ask "does our action color pass on our surface color?"
Create token pairs that are always tested together:
Export Formats
Dark Mode Strategy
Don't just invert colors. Instead, create a parallel token set where each semantic color meets contrast requirements on the dark surface:
:root { --color-text: #1e293b; --color-background: #f8fafc; }
.dark { --color-text: #f1f5f9; --color-background: #0f172a; }
Test both modes independently with the contrast checker.