Design Tokens at Scale: How Prim Turns Two Colors Into a Full System
Prim UI Team
Prim UI · Feb 20, 2026 · 7 min read
Most design systems start with a spreadsheet of hex codes and a prayer. You pick colors that look nice next to each other, then spend weeks discovering they don't work on dark backgrounds, fail contrast checks, or produce muddy mid-tones. Prim takes a different approach.
Two Colors In, 100+ Tokens Out
Pick a primary and an accent color. Prim generates complete 11-step scales, surface tokens, semantic mappings, and automatic dark mode — all with proper WCAG contrast ratios.
You give Prim two anchor colors — a primary and an accent — and it generates complete 11-step scales (50 through 950) for both, plus an independent secondary neutral scale with low chroma. Every shade is computed in OKLCH, so lightness values are perceptually uniform across the entire palette.
The surface system is equally systematic. Light mode surfaces use L values between 0.94 and 0.99 with minimal chroma. Dark mode surfaces sit between 0.15 and 0.25. The background gradient, card surfaces, and overlay colors are all derived from your secondary hue, ensuring visual coherence without manual tuning.
Semantic tokens form the bridge between raw scales and components. --prim-color-primary-500 is a scale token. --prim-bg-surface is a semantic token that resolves to different scale values in light vs dark mode. Components only reference semantic tokens, which is why theme switching works without touching component code.
You make two color choices and get a production-ready token system with 100+ CSS custom properties, proper WCAG contrast ratios, and instant dark mode. No spreadsheets, no prayers.