The Problem with Hardcoded Hex Codes and Pixel Values
When UI designers hardcode #2563eb and developers manually write hexadecimal colors throughout multiple CSS files, brand updates become engineering nightmares. Design tokens solve this by introducing semantic abstractions for all visual primitives.
Three-Tier Token Architecture
- Global Tokens: Raw values (e.g.
color-blue-600: #2563eb; space-4: 16px;). - Alias (Semantic) Tokens: Contextual intent (e.g.
color-primary: var(--color-blue-600); surface-card: var(--color-slate-50);). - Component Tokens: Scoped instances (e.g.
button-primary-bg: var(--color-primary);).