A robust design system shouldn't depend on raw hex codes like `#2563eb` or arbitrary pixel values scattered across codebase files. Design tokens act as the single source of truth for all visual attributes across both design and engineering workflows.
The 3-Tier Token Architecture
We structure design tokens into three cohesive abstraction layers:
- **Global (Primitive) Tokens**: Raw values like `color-blue-500: #2563eb` or `space-4: 16px`.
- **Semantic (Alias) Tokens**: Purpose-driven references like `color-action-primary: {color-blue-500}` and `color-surface-card: {color-neutral-0}`.
- **Component-Specific Tokens**: Tightly scoped variables like `button-primary-bg: {color-action-primary}`.
Automated Token Syncing
Using tools like Tokens Studio for Figma connected via GitHub Actions, every token adjustment published in Figma automatically transforms into clean CSS variables and Tailwind theme configurations.
