Foundations for Figma: Design Tokens, Styles, and Enterprise Design Systems

Foundations for Figma: Course Overview and Curriculum

  • Lecture 33 of the 1010-lecture free series Foundations for Figma, instructed by Ansh Mehra, focusing on design tokens, styles, and libraries within Figma.

  • Pre-requisite topics covered in earlier lectures:

    • Lecture 11: Fundamentals of Figma built entirely from scratch.

    • Lecture 22: Deep dive into the mechanics of frames and auto layout.

  • Core focus of Lecture 33: Mechanics of color styles, text styles, design token abstraction, enterprise design systems, and library publication.

  • Additional ecosystem resources available on learnuiux.in:

    • Specialized user experience (UX) design content for job applicants and case study writing.

    • Mentorship details, offline meetups, community events, and premium instructional offerings.

  • The lecture curriculum is divided into 33 structured modules:

    • Module 11: Core concepts of design tokens and Figma styles.

    • Module 22: Analysis of Uber Base, an enterprise-grade real-world design system.

    • Module 33: Practical implementation of text styles, color styles, batch automation, plugins, and libraries inside Figma.

Categorization of UI Color Palettes and Theme Physics

  • Every user interface (UI) color bank is structured into at least 33 fundamental color buckets:

    • Surface Grays: Backgrounds, structural cards, borders, and body text.

    • Brand Colors (Primary and Accent): Identity colors used for key interactive elements like primary buttons and branding highlights.

    • Semantic Colors: Functional feedback colors conveying state information (Red for alerts/errors, Yellow for warnings, Green for success/confirmations).

  • Principles of Light and Dark Themes in UI Design:

    • Light Theme Principles: Surfaces range from pure white (#FFFFFF) to subtle off-white grays. Stacking white cards on subtle gray backdrops creates visual structure.

    • Dark Theme Physics Principle: UI design assumes a virtual light source positioned directly in front of the screen.

    • Elevation Rule in Dark Theme: As a surface or card moves closer to the viewer (higher elevation), its shade becomes lighter. Recessed components (such as input fields) sit deeper into the screen and take darker shades. (Demonstrated in dark-themed applications like Tesla).

  • Systematic Segmentation of Gray Palettes:

    • Base Colors: Colors located at the lightest end of the spectrum in light theme, used for primary background surfaces.

    • Mid Colors: Mid-tone transition grays, used for borders, secondary structural elements, and subtle dividers.

    • Contrast Colors: High-contrast shades nearing pitch black, used for primary body typography, headings, and high-emphasis elements.

  • Managing Interactive States:

    • Button states require variations of primary brand colors (e.g., Default vs. Hover).

    • Hover states are systematically derived rather than randomized; a common method involves applying a 20%20\% dark opacity overlay or calculating a precise darker hex variant to maintain mathematical consistency across states.

Fundamentals of Design Tokens and Abstraction

  • The Hex Code Communication Problem: Raw hexadecimal values (such as #7FE52) are difficult to memorize, communicate, and maintain across cross-functional product teams.

  • Concept of Abstraction and Aliasing:

    • Abstraction hides technical complexity behind clean, human-readable labels (analogous to shifting gears in a car without needing to manage the underlying mechanical transmission).

    • An alias is an alternate human-readable name assigned to a raw root value (hex code).

  • Structure of Multi-Tiered Design Tokens:

    • Tier 11 (Root Value / Raw Value): The foundational hardcoded hex string (e.g., #7FE52).

    • Tier 22 (Global / Primitive Token Name): A standardized system-wide descriptor assigned to the root value (e.g., yellow-100 or blue-100).

    • Tier 33 (System / Semantic / Alias Token Name): A contextual classification indicating functional intent (e.g., UI-primary-1 or semantic-alert).

    • Tier 44 (Component / Instance-Specific Token Name): An explicit element mapping defining exact usage (e.g., pill-primary-background, alert-icon-fill, or modal-text).

  • Token Scope across Design Properties:

    • Colors frequently utilize multi-tier hierarchy due to broad variations in themes and component usages.

    • Typography, spacing, borders, shadows, and corner radii usually operate on single-tier simple scales (e.g., Font sizes simplified to 8 px8\,\text{px} as Small, 12 px12\,\text{px} as Medium, 16 px16\,\text{px} as Large).

Architecture of Enterprise Design Systems: Uber Base Analysis

  • Overview of Uber Base (base.uber.com):

    • Enterprise design system powering Uber products, featuring public design token documentation and usage standards.

  • Token Anatomy in Design vs. Engineering:

    • Design Standard: Token = Name + Value (with optional Type and Description metadata).

    • Engineering Standard: Token = Key + Value (e.g., Key: $button-primary, Value: Hex/String/Number/Boolean).

    • Keys are strictly unique identifiers; a single key cannot map to multiple distinct values.

  • Supported Token Types in Uber Base (88 Core Types):

    • Colors

    • Typography

    • Layout Grids

    • Dimensions

    • Corner Radii

    • Haptics

    • Spacing

    • Shadows / Elevation

  • Uber Base Color Architecture (33 Main Tiers):

    • Tier 11 (Primitives): The global bank of 100+100+ raw hex code values covering every possible shade.

    • Tier 22 (Categorized Collections):

    • Foundations: 66 core brand values representing identity colors.

    • Core: 1717 gray palette values strictly segmented into Backgrounds (surfaces), Content (typography and icons), and Borders (strokes).

    • Extensions: 2929 values covering scrims, blankets, dark overlays, and semantic status shades.

    • Programs: Static color tokens that do not change when toggling between Light and Dark themes.

    • Tier 33 (Component-Specific Tokens): Applied directly to UI patterns (e.g., secondary-button-content, input-value-text, border-selected).

  • Atom Decomposition Rule in Component Design:

    • Every UI component in Uber Base breaks down into 33 basic atomic sub-elements: Background, Content, or Border.

Multi-Tiered Token Naming Conventions and Structures

  • Constructing Industry-Standard Token Names:

    • Token names express precise functional metadata using structured dashes (-) rather than slashes (/) to prevent code parsing conflicts.

    • Standard Metadata Hierarchy: [System]-[Component]-[Variant]-[Property]-[State]

    • Example Token Name 11: UI-pill-primary-background

    • UI: Design system library identifier.

    • pill: Target UI component.

    • primary: Component variant state.

    • background: Property attribute (fill layer).

    • Example Token Name 22: UI-button-primary-background-active

    • Captures exact component state (active / hover / disabled).

Practical Implementation in Figma: Color Styles and Batch Automation

  • Styles vs. Variables in Figma:

    • Figma Color Styles: Support single-tier mapping directly from hex code to a global style name.

    • Figma Variables: Support multi-tiered token linking, native Light/Dark theme mode swapping, and variable aliasing.

  • Grouping Styles with Slash Convention (/):

    • Using slashes in style names (Category/Subcategory/Name) automatically creates organized nested folders in Figma's inspector panel.

    • Formatting Examples: gray/base-1, gray/mid-2, sem/alert-1.

  • Automated Batch Workflow for Declaring Color Styles:

    1. Organize canvas color swatches cleanly in visual order.

    2. Run the Sorter plugin to align canvas visual position with the layers panel order.

    3. Select all swatches and open Batch Rename (Command + R).

    4. Apply prefix naming syntax: gray/ combined with current name or sequential ascending counters ($n).

    5. Run the Styler plugin via Command + / (Generate Styles). Styler automatically reads layer names containing slashes and generates structured Figma color styles instantly.

Practical Implementation in Figma: Typography Scale and Formatting

  • Typography Standards in Digital Products:

    • Minimum Font Size Rule: Never set product typography below 12 pixels12\,\text{pixels} to protect readability and pass accessibility standards.

    • Google Fonts Integration: Strongly recommended due to open-source licensing, fast load times, and pre-fed native integration inside Figma.

  • Typography Functional Categories (33 Core Categories):

    • Labels: Single-line UI text (e.g., buttons, input labels, badge tags). Line height must be set to 100%100\% or tight pixel dimensions with letter spacing adjusted (e.g., Inter −2%-2\%).

    • Headings / Displays: Large scale headline typography used for visual anchors.

    • Paragraphs: Multi-line body typography. Line height must be explicitly calculated as an integer numerical value corresponding to at least 135%135\% of font size (e.g., 16 px16\,\text{px} font size mapped to 22 px22\,\text{px} or 24 px24\,\text{px} line height).

  • Standard Font Weight Mappings:

    • Regular = 400400

    • Medium = 500500

    • Semi-Bold = 600600

    • Bold = 700700

  • Structural Type Naming Scale:

    • Example Label Nomenclature: label/L1-reg-400 down to label/L5-bol-700 (where smaller numeric indices represent larger font sizes).

Figma Plugins, Team Libraries, and Workflow Management

  • Essential Figma Plugins for Design Efficiency:

    • Find and Replace: Canvas-wide text search and string replacement tool.

    • Ghost UX Writer: Microcopy generator providing standardized text strings for error states, success banners, and onboarding inputs.

    • Spell: Canvas spell-checking tool designed to eliminate typographical errors across layout files.

  • Architecture of Published Team Libraries:

    • Master File: Hosts foundational primitives, color styles, text styles, and core components.

    • Publishing Process: Navigate to Assets Panel -> Click Book Icon -> Click Publish Library.

    • Syncing Requirement: Requires a Figma Pro plan to enable live asset syncing across external project files.

    • Modular Component Strategy: Store icon sets (e.g., BoxIcons UI kit) in dedicated separate files, published as standalone libraries, rather than copy-pasting raw vectors into product files.

Industry Resources, Design Repositories, and Career Roadmap

  • Benchmark Design System Documentation Repositories:

    • base.uber.com: Uber Base design system documentation.

    • designsystemsrepo.com: Collection of major corporate design systems (e.g., Audi UI, IBM Carbon).

    • designsystemsforfigma.com: Repository providing official Figma community UI kits for enterprise design systems.

  • Learning and Portfolio Platforms:

    • learnuiux.in: UX design roadmaps, 1515-episode foundation course, case study writing frameworks, mentorship, and event details.

    • howtoprompt.in: Educational platform covering AI prompting, ChatGPT applications, and prompt engineering.

  • Career Progression Guidelines:

    • Becoming job-ready requires consistent practice spanning 6 to 8 months6\,\text{to } 8\,\text{months}, dedicating 2 to 2.5 hours2\,\text{to } 2.5\,\text{hours} daily to core UX/UI execution and Figma mastery.