Public specification and governance standard for design variables. DTCG 2025.10 compliant format with naming rules, validation requirements, versioning strategy, and adapter patterns.
Version: 0.3.7 Status: Draft Editor: Mark Learst
Variables are variables. CSS variables, JavaScript variables, Figma variables. Variables Contract standardizes how we name, structure, and govern them. No metaphors. No cute names. Just variables.
If variables are managed without a contract, you get silent renames, broken references, inconsistent naming, tool lock-in, and production failures.
Variables Contract defines:
- JSON structure (DTCG 2025.10 format)
- Naming convention (dot-separated paths, lowercase, no platform prefixes)
- Reference syntax (curly brace
{path.to.variable}and JSON Pointer#/path/to/variable) - Validation requirements (structure, naming, references, types, modes)
- Versioning strategy (semantic versioning, breaking change definitions)
- Adapter patterns (Figma, Tokens Studio, Style Dictionary)
Variables Contract does NOT define:
- Variable values (your design decisions)
- Tools to use (works with any DTCG-compliant tool)
- Consumption patterns (CSS, TypeScript, whatever works)
- Design system decisions (governs structure, not values)
Variables are variables. CSS variables, JavaScript variables, Figma variables. They store values, can be referenced, and can be changed.
"Design tokens" creates confusion. Developers know variables. Designers know variables. Variables Contract uses the term everyone understands.
See Why Variables for the full argument.
Everyone calls them something different: design tokens, style properties, design constants, variables, tokens. This creates confusion and separation between design and code.
Variables Contract standardizes on "variables" and provides clear naming rules.
Variables change without rules. Renames break components. Invalid references ship to production. Breaking changes go unnoticed.
Variables Contract provides governance: naming rules, validation requirements, versioning strategy, change control process.
Variables are tied to specific tools. Figma exports don't work with Style Dictionary. Tokens Studio format doesn't match DTCG. Migration is painful.
Variables Contract is tool-agnostic. Use any tool. Adapters normalize tool outputs to the contract.
Design and code don't align. Designers create variables in Figma. Developers consume CSS variables. The connection breaks.
Variables Contract bridges the gap. Variables flow from Figma through adapters to version control to generated outputs.
Invalid variables ship to production. Broken references break components. Type mismatches cause runtime errors.
Variables Contract requires validation. CI checks catch errors before they ship.
Variables Contract is DTCG 2025.10 compliant. Any JSON file that follows Variables Contract rules is valid DTCG 2025.10 format.
What DTCG provides:
- JSON structure for variables and groups
- Type system (color, dimension, fontFamily, etc.)
- Reference syntax (curly brace and JSON Pointer)
- Composite types (border, transition, shadow, gradient, typography)
- Group extension with
$ref - Mode support
What Variables Contract adds:
- Naming convention rules
- Change control process
- Validation requirements beyond format correctness
- Versioning strategy
- Adapter patterns for tool integration
See DTCG Alignment for details.
- Read Getting Started
- Set up repository structure (
tokens/directory) - Install validation tools
- Configure CI validation
- Export variables from Figma
- Run adapter to normalize
- Commit normalized JSON
- Generate outputs (CSS, TypeScript)
See Implementation Checklist for complete setup.
- Read Figma Naming
- Create variables in Figma following naming convention
- Use semantic variables in components
- Export variables
- Follow Figma Workflow
- Read CSS Consumption or TypeScript Consumption
- Use generated CSS variables or TypeScript types
- Follow Framework Integration for React/Vue
- Test variable consumption
- Read Variable Contract
- Set up Validation
- Configure CI/CD
- Review Change Control
- Manage Versioning
- Why Variables - Why "variables" not "design tokens"
- Comparison - Variables Contract vs DTCG, Style Dictionary, Material, Adobe
- Positioning - What Variables Contract is and is not
- Variables Contract - JSON shape and structure
- Groups - Group structure and extension
- References - Reference syntax and resolution
- Modes - Mode structure and resolution
- Types - Type system reference
- Composite Types - Border, Transition, Shadow, Gradient, Typography
- Naming - Naming convention
- Anatomy - Base, alias, and component tokens
- Getting Started - Team adoption guide
- Implementation Checklist - Pre/post implementation checklists
- Migration Strategy - Phased migration approaches
- Governance Overview - Governance principles and workflow
- Change Control - Review and release process
- Validation - Validation tools and CI setup
- Versioning - Semantic versioning and breaking changes
- Migration - Migrating from other formats
- Troubleshooting - Common issues and solutions
- Accessibility - Accessibility constraints
- Multi-Brand - Multi-brand architecture patterns
- Multi-Theme - Theme composition and mode inheritance
- Large Sets - Performance considerations
- Component Integration - Component library integration
- Ecosystem - Tools that support Variables Contract
- CI/CD - CI/CD integration patterns
- Build Pipelines - Complete build pipeline examples
- Figma Adapter - Figma export normalization
- Tokens Studio Adapter - Tokens Studio export normalization
- Style Dictionary Adapter - CSS/TypeScript output generation
- CSS - CSS variable consumption patterns
- TypeScript - TypeScript type generation
- Frameworks - React/Vue integration
- Figma Naming - How to name variables in Figma
- Figma Workflow - Designer workflow
- Component Variables - Using variables in Figma components
- Validation - Testing variable changes
- Visual Regression - Visual regression testing
- Consumption Tests - Testing generated outputs
- Multi-Brand Architecture - Complete multi-brand example
- Theme Composition - Theme composition patterns
- Performance - Performance optimization
Variables Contract JSON files MUST:
- Use DTCG 2025.10 format
- Follow naming convention (dot-separated paths, lowercase, no platform prefixes)
- Use canonical reference syntax (
{path.to.variable}) - Include
$typeand$valueon all variables - Resolve all references (no broken references)
- Avoid circular references
- Use consistent mode keys within collections
Variables Contract JSON files SHOULD:
- Include
$descriptionwhen intent is not obvious - Use semantic aliases for UI consumption
- Keep modes limited (
light,dark) - Organize by category (base, semantic, component)
See Validation Checklist for complete requirements.
Variables Contract requires validation at multiple points:
- After adapter normalization (check structure, naming, references)
- In CI on every PR (block invalid changes)
- Before build (verify contract compliance)
- After build (test generated outputs)
Validation checks:
- JSON syntax (valid JSON structure)
- Variable structure (
$typeand$valuepresent) - Naming convention (dot-separated paths, lowercase)
- Reference resolution (all references resolve)
- Circular reference detection (no reference cycles)
- Type correctness (
$valuematches$type) - Mode consistency (mode keys shared within collections)
See Validation for validation tools and CI setup.
Variables Contract uses semantic versioning (MAJOR.MINOR.PATCH):
- MAJOR: breaking changes (renames, removals, type changes)
- MINOR: new variables, new modes, non-breaking additions
- PATCH: bug fixes, documentation updates
Breaking changes:
- Variable renames
- Variable removals
- Type changes
- Reference changes that break intent
Non-breaking changes:
- New variables
- New modes
- Value changes (if documented and intentional)
See Versioning for complete versioning strategy.
Adapters normalize tool outputs into Variables Contract format.
Normalizes Figma Variables export JSON:
- Extracts
$collection_metadatato$extensions - Extracts
$variable_metadatato$extensions - Removes
@prefix from collection names - Converts reference syntax
{@collection.token}to{collection.token} - Moves mode values from metadata to
$valueobject
See Figma Adapter for details.
Normalizes Tokens Studio export JSON:
- Validates DTCG format compliance
- Checks naming convention
- Verifies reference syntax
- Preserves Tokens Studio metadata in
$extensions
See Tokens Studio Adapter for details.
Generates platform outputs from Variables Contract JSON:
- CSS variables
- TypeScript types
- Tailwind CSS v4 (CSS custom properties)
- SCSS variables
- Other platform formats
See Style Dictionary Adapter for details.
- Figma Export JSON - Example Figma export
- DTCG Compliant Example - Complete DTCG 2025.10 example
- Adapter Pipeline - End-to-end transformation example
Variables Contract is part of UMP (UI Mapping Protocol), a larger system for mapping design and development artifacts.
UMP components:
- Variables Contract (this spec) - variables/tokens
- Component Contract (future) - component mapping
- Pattern Contract (future) - pattern mapping
- Design-Dev Mapping (future) - artifact relationships
Variables Contract is the first piece of UMP, focusing on variables.
Variables Contract is:
- DTCG 2025.10 compliant
- Production-ready
- Tool-agnostic
- Validated in CI
- Used by teams
Variables Contract is NOT:
- A W3C standard (uses DTCG format)
- A tool (works with existing tools)
- A design system (governs structure, not values)
- Complete UMP system (focuses on variables)
If Variables Contract is not used:
- Silent renames break components
- Broken references cause production failures
- Inconsistent naming creates confusion
- Tool lock-in prevents migration
- No validation allows invalid variables to ship
- Versioning chaos makes upgrades risky
If Variables Contract is used incorrectly:
- Skipping validation allows invalid variables to ship
- Not following naming convention breaks code generation
- Ignoring versioning causes breaking changes without notice
- Skipping adapters leaks tool metadata into contract
- Not testing consumption breaks component styling
Variables Contract is a public specification. Contributions welcome.
Before contributing:
- Read WRITING_GUIDE.md
- Follow writing guide rules (no slop words, testable requirements)
- Include examples for new concepts
- Document failure modes
- Add validation checklists
Documentation is built with docmd.
pnpm installpnpm run docs:devStarts local development server at http://localhost:3000.
pnpm run docs:buildGenerates static site in site/.
Editor: Mark Learst
Variables Contract is maintained by the editor. Contributions welcome.
Variables Contract builds on:
- DTCG 2025.10 Format - Base format specification
- Style Dictionary - Output generation tool
- Figma Variables - Design tool integration
- Tokens Studio - Design tool integration
- DTCG 2025.10 Specification - Design Tokens Community Group format
- Variables Contract Documentation - Complete specification and governance
- DTCG Alignment - Compliance details
To claim Variables Contract compliance:
- Use DTCG 2025.10 format for variable JSON
- Follow naming convention (dot-separated paths, lowercase, no platform prefixes)
- Use canonical reference syntax (
{path.to.variable}) - Validate variables (structure, naming, references, types, modes)
- Use semantic versioning for variable releases
- Document breaking changes
See Conformance for complete conformance requirements and test suite.
This work is licensed under the Creative Commons Attribution 4.0 International License.
See LICENSE for full license text.