Design Tokens Reference
A complete reference of all design token categories, their values, and how they map to generated code.
What Are Design Tokens?
Design tokens are the atomic building blocks of a design system. They store visual design decisions — colors, fonts, spacing, etc. — as named, platform-agnostic values. Instead of scattering #2563eb across 47 files, you define it once as--color-primary and reference it everywhere.
YuBild takes this further: you configure tokens visually, and YuBild generates them asCSS variables, Tailwind config values, orlibrary-specific theme objects — all from a single source of truth.
Colors
The most impactful token category. Defines your entire brand palette and how every component looks.
Semantic Color Roles
| Token | Purpose | Usage Examples |
|---|---|---|
| colorPrimary | Main brand color | CTA buttons, active tabs, links, selected states, progress bars |
| colorSecondary | Supporting brand color | Secondary buttons, tags, badges, less prominent actions |
| colorAccent | Decorative emphasis | Notification badges, highlights, decorative elements, feature callouts |
| colorDestructive | Danger / error | Delete buttons, error alerts, validation errors, destructive confirmations |
| colorBackground | Main surface | Page background, card surfaces, dialog backgrounds |
| colorForeground | Primary text | Body text, headings, icon fill on light backgrounds |
| colorMuted | Subtle surface | Sidebar backgrounds, table header rows, disabled surfaces, code block backgrounds |
| colorBorder | Default border | Input borders, card outlines, dividers, table cell borders |
| colorRing | Focus ring | Keyboard focus outlines on buttons, inputs, links (accessibility) |
Auto-Generated Color Scales
When you set a base color (e.g., primary = #2563eb), YuBild generates11 shade variants from 50 (lightest) to 950 (darkest):
/* Primary = #2563eb */
--primary-50: #eff6ff; /* Very light blue, backgrounds */
--primary-100: #dbeafe; /* Light tint, hover states */
--primary-200: #bfdbfe; /* Lighter shade */
--primary-300: #93c5fd; /* Medium light */
--primary-400: #60a5fa; /* Medium */
--primary-500: #3b82f6; /* Base shade (close to input) */
--primary-600: #2563eb; /* ← Your base color */
--primary-700: #1d4ed8; /* Darker, active states */
--primary-800: #1e40af; /* Dark, text on light */
--primary-900: #1e3a8a; /* Very dark */
--primary-950: #172554; /* Darkest, high contrast */Each shade also gets an accessible contrast color calculated based on luminance. Light shades (50-400) get dark contrast text, dark shades (500-950) get white text. This ensures WCAG AA compliance when using any shade as a background.
Note
Typography
Typography tokens control every aspect of text rendering across your design system.
Font Families
| Token | Applied To | Typical Choices |
|---|---|---|
| fontHeading | h1, h2, h3, h4, h5, h6 | Cal Sans, Plus Jakarta Sans, Clash Display, Manrope |
| fontBody | p, span, labels, UI text, buttons | Inter, Geist, DM Sans, Nunito Sans, Source Sans 3 |
| fontMono | code, pre, kbd, terminal | JetBrains Mono, Fira Code, Source Code Pro, IBM Plex Mono |
Font Size Scale
The default type scale follows a modular ratio:
| Token | Size | Usage |
|---|---|---|
| xs | 0.75rem (12px) | Captions, fine print, badges |
| sm | 0.875rem (14px) | Secondary text, labels, table cells |
| base | 1rem (16px) | Body text, paragraphs, buttons |
| lg | 1.125rem (18px) | Lead paragraphs, card titles |
| xl | 1.25rem (20px) | Section titles, h5 |
| 2xl | 1.5rem (24px) | H4 headings |
| 3xl | 1.875rem (30px) | H3 headings |
| 4xl | 2.25rem (36px) | H2 headings |
| 5xl | 3rem (48px) | H1 headings, hero titles |
| 6xl | 3.75rem (60px) | Display text, landing page heroes |
Spacing
Spacing tokens define the rhythm of your layout. YuBild uses a base-unit system where all spacing values are multiples of a base unit:
| Preset | Base Unit | spacing-4 | spacing-8 | Best For |
|---|---|---|---|---|
| Compact | 3px | 12px | 24px | Dashboards, data tables, dense UIs |
| Normal | 4px | 16px | 32px | Most applications (default) |
| Relaxed | 5px | 20px | 40px | Content sites, blogs, documentation |
| Spacious | 6px | 24px | 48px | Marketing, editorial, luxury |
Shadows
Shadow tokens define elevation levels. Each intensity preset generates 6 shadow values:
| Level | Usage | Applies To |
|---|---|---|
| sm | Minimal elevation | Buttons, small elements |
| DEFAULT | Standard elevation | Cards, panels |
| md | Medium elevation | Dropdowns, popovers |
| lg | High elevation | Modal headers, sticky nav |
| xl | Very high elevation | Modals, dialogs |
| 2xl | Maximum elevation | Floating action buttons, overlays |
Tip
none — perfect for modern flat designs. "Subtle" uses soft, barely visible shadows. "Medium" is the standard Material-like elevation. "Strong" creates pronounced, dramatic shadows.Border Radius
Controls the corner rounding of all components. The base value propagates to derived sizes:
/* Example: border-radius = "lg" (8px) */
--radius-base: 8px;
--radius-sm: 4px; /* base / 2, min 2px */
--radius-lg: 16px; /* base * 2 */
--radius-full: 9999px; /* always full circle */Borders
Configures default border width. The border color comes from your colorBorder token. Width options: thin (1px), normal (1.5px), thick (2px), heavy (3px).
Effects
| Token | Range | What It Controls |
|---|---|---|
| blurIntensity | none (0px) → strong (20px) | Backdrop blur on overlays, modals, frosted glass effects |
| opacityDisabled | 0–100% | How transparent disabled buttons, inputs, and controls appear |
| opacityHover | 0–100% | Hover overlay opacity on interactive elements |
| opacityBackdrop | 0–100% | Modal/dialog backdrop overlay darkness |
Motion
Animation tokens control the feel of all transitions and animations:
- Speed: instant (0ms), fast (100ms), normal (200ms), relaxed (300ms), slow (500ms)
- Easing: ease, ease-in, ease-out, ease-in-out, linear, spring
These apply globally to hover effects, menu animations, accordion transitions, dialog entrances, tooltip appearances, and any other interactive state change.
Note
cubic-bezier(0.175, 0.885, 0.32, 1.275). It gives a subtle bounce effect that feels organic.Focus & Accessibility
Focus tokens ensure keyboard users can see where they are in the interface:
- Ring Width — Outline thickness: 1px (subtle), 2px (standard), 3px (prominent), 4px (high visibility)
- Ring Offset — Gap between element edge and ring: 0px (flush), 1px, 2px, 3px, 4px
The ring color comes from your colorRing token. Together, these three values produce the focus outline: outline: [width] solid [color]; outline-offset: [offset];
Warning
Z-Index
Z-index tokens prevent the common problem of arbitrary z-index: 9999 values scattered across your codebase. YuBild defines named layers:
| Layer | Flat | Normal | Elevated |
|---|---|---|---|
| base | 1 | 10 | 100 |
| dropdown | 5 | 50 | 500 |
| sticky | 10 | 100 | 1000 |
| overlay | 15 | 200 | 2000 |
| modal | 20 | 500 | 5000 |
| popover | 25 | 700 | 7000 |
| toast | 30 | 800 | 8000 |
| tooltip | 50 | 9999 | 99999 |
Flat uses minimal values for simple apps. Normal is the standard for most applications. Elevated provides wide gaps between layers for complex UIs with nested overlays (e.g., a tooltip inside a modal on top of a sidebar).