Skip to main content

Lesson 2 of 5

Design Tokens & Brand Foundations

Design tokens are the single source of truth for your visual design language - the bridge between design and development. Instead of scattered hex codes and pixel values across hundreds of files, tokens create a named, versioned, platform-agnostic system where a single value update propagates across iOS, Android, and web simultaneously. This is how Netflix, GitHub, and Atlassian maintain visual consistency across dozens of products and platforms.

50 minBy Priygop Editorial TeamUpdated 2026Peer Reviewed & Verified

Understanding Design Tokens

Design tokens are named entities that store visual design attributes - colors, typography, spacing, shadows, animation timings, and more. Instead of hardcoding '#229c6b' everywhere, you define a token called 'color-primary-500' that maps to that value. If the brand color changes, update the token once and it propagates everywhere. Tokens exist at multiple levels: Global tokens are raw values ('blue-500': #229c6b). They don't carry meaning - they're just the full palette. Alias tokens (semantic tokens) give meaning ('color-interactive': blue-500, 'color-danger': red-500). These are consumed by components. Component tokens are specific to a component ('button-background': color-interactive). Leading tools: Figma Variables (for design-side token management), Style Dictionary (transforms JSON tokens to any platform format), Tokens Studio for Figma (the most popular Figma token plugin, connects to GitHub).

Diagram
Loading diagramโ€ฆ

Design Tokens & Brand Foundations: Visual guide and core principles.

Token Categories & Structure

  • Color Tokens: Global palette (gray-50 through gray-900, blue-50 through blue-900), semantic aliases (color-text-primary, color-text-secondary, color-surface, color-border, color-interactive, color-success, color-warning, color-danger, color-info), and dark mode variants
  • Typography Tokens: Font family (font-sans, font-mono, font-serif), font weight (font-regular: 400, font-medium: 500, font-semibold: 600, font-bold: 700), type scale (text-xs: 12px, text-sm: 14px, text-base: 16px, text-lg: 18px, text-xl: 20px, text-2xl: 24px, text-3xl: 30px, text-4xl: 36px)
  • Spacing Tokens: 4px base unit scale - spacing-1: 4px, spacing-2: 8px, spacing-3: 12px, spacing-4: 16px, spacing-5: 20px, spacing-6: 24px, spacing-8: 32px, spacing-10: 40px, spacing-12: 48px, spacing-16: 64px. Every margin, padding, and gap value should come from this scale
  • Shadow Tokens: Elevation levels - shadow-none, shadow-sm (subtle cards), shadow-md (default cards), shadow-lg (dropdowns, popovers), shadow-xl (modals, drawers)
  • Border Tokens: border-radius-none, border-radius-sm: 4px, border-radius-md: 8px, border-radius-lg: 12px, border-radius-xl: 16px, border-radius-full: 9999px. Border width: border-thin: 1px, border-thick: 2px
  • Motion Tokens: duration-instant: 0ms, duration-fast: 150ms, duration-normal: 300ms, duration-slow: 500ms. Easing: easing-standard: cubic-bezier(0.4, 0, 0.2, 1), easing-decelerate: cubic-bezier(0, 0, 0.2, 1), easing-accelerate: cubic-bezier(0.4, 0, 1, 1)

Implementing Design Tokens

  • Platform-agnostic source: Store tokens in JSON - this file is your single source of truth. Every platform generates its own format from this source using Style Dictionary
  • CSS Custom Properties: --color-primary: #229c6b generated from JSON. These support runtime theme switching - change a CSS variable value and the entire UI updates without reload
  • Dark Mode with tokens: Create semantic aliases that point to different global tokens per color scheme. --color-surface maps to white in :root and gray-900 in [data-theme='dark'] or @media (prefers-color-scheme: dark)
  • Multi-brand theming: Same component library, different token sets. Product A uses blue primary tokens; Product B uses purple primary tokens. The component library is brand-agnostic - only the token set is brand-specific
  • Figma Variables โ†’ Code: With Figma Variables (Figma's native token system since 2023), you can create Number, String, Boolean, and Color variables. The Tokens Studio plugin or Figma's own REST API enables syncing these variables to your JSON token file
  • Version control: Track token JSON files in Git alongside component code. Token changes generate a diff just like code changes - reviewable, auditable, and rollback-able. Critical for maintaining design-development parity

Tip

Tip

Practice Design Tokens Brand Foundations in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.

Practice Task

Note

Practice Task - (1) Write a working example of Design Tokens Brand Foundations from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.

Quick Quiz

Common Mistake

Warning

A common mistake with Design Tokens Brand Foundations is skipping edge case testing - empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready ui ux code.

Key Takeaways

  • Design tokens are the single source of truth for your visual design language - the bridge between design and development.
  • Color Tokens: Global palette (gray-50 through gray-900, blue-50 through blue-900), semantic aliases (color-text-primary, color-text-secondary, color-surface, color-border, color-interactive, color-success, color-warning, color-danger, color-info), and dark mode variants
  • Typography Tokens: Font family (font-sans, font-mono, font-serif), font weight (font-regular: 400, font-medium: 500, font-semibold: 600, font-bold: 700), type scale (text-xs: 12px, text-sm: 14px, text-base: 16px, text-lg: 18px, text-xl: 20px, text-2xl: 24px, text-3xl: 30px, text-4xl: 36px)
  • Spacing Tokens: 4px base unit scale - spacing-1: 4px, spacing-2: 8px, spacing-3: 12px, spacing-4: 16px, spacing-5: 20px, spacing-6: 24px, spacing-8: 32px, spacing-10: 40px, spacing-12: 48px, spacing-16: 64px. Every margin, padding, and gap value should come from this scale

Hands-on Practice Tools for this Course

Test what you learn using these free in-browser developer utilities (no signup required).

All 40+ Tools

Topics in This Module

0/5 done