v0.1.6·Systems
Design Tokens
Complete reference of design tokens including colors, typography, spacing, and more
Published: 12/15/2025

Design Tokens

Design tokens are named design values that represent design decisions as reusable, centrally-managed variables. Use tokens instead of hardcoding values to enable theme swapping and maintain consistency.

Instead of:

.button {
  background-color: #4F46E5;
  padding: 8px 16px;
  font-size: 16px;
}

Use:

.button {
  background-color: var(--accent-600);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-md);
}

Token Categories

Colors, typography, spacing, shadows, borders, and motion


Color Tokens

All colors use OKLCH color space (perceptually uniform). Pattern: {family}-{shade} where shade ranges 50 (lightest) to 950 (darkest).

Core families: Background, Foreground, Accent Semantic: Success (green), Danger (red), Warning (yellow), Info (blue)

Shade Selection Guide

Shade RangeUse CaseExamples
**50-100**Light backgrounds, hover statesCard backgrounds, tooltips
**200-300**Light accents, bordersInput borders, dividers
**400-500**Medium, interactive statesButton backgrounds, links
**600-700**Bold accents, dark mode backgroundsPrimary buttons, section backgrounds
**800-900**Dark text, dark backgroundsText color, dark mode text
**950**Darkest, text on lightHeadlines, strong emphasis

Typography Tokens

Families:

  • --font-family-sans: System fonts (primary)
  • --font-family-mono: Monospace (code, data)

Font Size Tokens

TokenValueUse Case
--font-size-xs0.75rem (12px)Captions, metadata
--font-size-sm0.875rem (14px)Small text, help
--font-size-md1rem (16px)Body text, default
--font-size-lg1.25rem (20px)Large labels
--font-size-xl1.5rem (24px)Subheadings
--font-size-2xl1.875rem (30px)Page titles
--font-size-3xl2.25rem (36px)Display headings

Font Weight Tokens

TokenValueUse Case
--font-weight-regular400Body text
--font-weight-medium500Labels, emphasis
--font-weight-bold700Headings, strong

Line Height Tokens

TokenValueUse Case
--line-height-tight1.25Headings, compact
--line-height-normal1.5Body text, standard
--line-height-relaxed1.75Long-form, accessibility

Complete Text Style Tokens

Pre-combined typography tokens:

TokenIncludesUse Case
--text-h12.25rem, 700, 1.25Page titles
--text-h21.875rem, 700, 1.25Section titles
--text-h31.5rem, 700, 1.5Subsections
--text-h41.25rem, 700, 1.5Minor headings
--text-body-lg1rem, 400, 1.5Lead paragraphs
--text-body1rem, 400, 1.5Standard body
--text-body-sm0.875rem, 400, 1.5Secondary text
--text-label0.875rem, 500, 1.25Form labels
--text-caption0.75rem, 400, 1.25Metadata
--text-code0.875rem mono, 400, 1.5Code blocks

Spacing Tokens

All spacing tokens use 4px as the base unit with a 1.5x ratio between steps.

TokenPixelsREMUse Case
--space-0.52px0.125remMinimal gaps
--space-14px0.25remTight spacing
--space-28px0.5remButton padding
--space-312px0.75remComponent padding
--space-416px1remStandard spacing
--space-624px1.5remSection spacing
--space-832px2remMajor sections
--space-1248px3remLarge sections
--space-1664px4remHero sections
--space-2080px5remPage spacing
--space-2496px6remFull-width sections

Border Radius Tokens

Consistent corner rounding throughout the interface:

TokenValueUse Case
--radius-sm2pxSubtle rounding
--radius-md4pxSmall components
--radius-lg8pxCards, buttons
--radius-xl12pxLarge cards, modals
--radius-2xl16pxExtra large elements
--radius-full9999pxFully rounded (pills, circles)

Shadow/Elevation Tokens

Depth system using box shadows:

TokenUsageUse Case
--shadow-smSmall shadowSubtle elevation
--shadow-mdMedium shadowStandard elevation
--shadow-lgLarge shadowProminent elevation
--shadow-xlExtra large shadowHigh elevation

Motion/Animation Tokens

Duration Tokens

TokenValueUse Case
--duration-fast100msQuick interactions
--duration-base200msStandard animations
--duration-slow300msComplex animations

Easing Tokens

TokenTiming FunctionUse Case
--ease-incubic-bezier(0.4, 0, 1, 1)Exiting animations
--ease-outcubic-bezier(0, 0, 0.2, 1)Entering animations
--ease-in-outcubic-bezier(0.4, 0, 0.2, 1)Continuous animations

Using Tokens

CSS: color: var(--foreground-950); padding: var(--space-4);

Tailwind: <div class="bg-accent-600 p-4">Content</div>

JavaScript: getComputedStyle(document.documentElement).getPropertyValue('--space-4')


Naming Conventions

Color Tokens

Pattern: --{family}-{shade}

Examples:

  • --background-50, --background-950
  • --success-600
  • --danger-300

Typography Tokens

Pattern: --font-{property} or --text-{style}

Examples:

  • --font-family-sans
  • --font-size-md
  • --font-weight-bold
  • --text-body
  • --text-h1

Spacing Tokens

Pattern: --space-{multiplier}

Examples:

  • --space-1, --space-4, --space-12

Other Tokens

Pattern: --{category}-{descriptor}

Examples:

  • --radius-lg
  • --shadow-md
  • --duration-base
  • --ease-in-out

Semantic vs. Descriptive

Semantic Naming (Preferred)

Token names describe their purpose or meaning:

--success-600 (used for success states)
--danger-500 (used for errors)
--foreground-950 (used for text)

Descriptive Naming (Avoid)

Token names describe their appearance:

--green-600 (color doesn't indicate purpose)
--red-500 (red could mean danger or warm)
--dark-text (not specific enough)

Why semantic is better:

  • Easy to swap themes without changing code
  • More maintainable across the project
  • Clearer intent for developers
  • Facilitates accessibility (e.g., danger colors can change if needed)

Token Inheritance & Composition

Single Value Tokens

Basic tokens representing a single decision:

--space-4: 1rem
--font-size-md: 1rem
--accent-600: oklch(50% 0.15 260)

Composite Tokens

Tokens combining multiple values for efficiency:

--text-body: 1rem / 1.5 "system-ui, ..."
--shadow-md: 0 4px 6px rgba(0,0,0,0.1)

Token Combinations

Using multiple tokens together:

.card {
  padding: var(--space-6);
  background-color: var(--background-50);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

Accessibility Considerations

  • Color Contrast: Minimum 4.5:1 for text, 3:1 for graphics
  • Font Sizes: Body 16px+, small text 14px+, captions 12px+
  • Touch Targets: Minimum 44px × 44px with 8px gaps
© 2025 UI Lab • Built for humans and machines