Point to an element to see the design tokens behind it.
Back to artifacts

SemVer for Design Variables

Versioning design tokens like an API, so a rename shows up as a breaking change before it reaches production. Part of the Variable Design Standard.

  • design-systems
  • tokens
  • standards

The problem

A designer renames color.brand.primary to color.brand.main in Figma. Seems harmless. Three weeks later, 47 components are rendering fallback colors in production because the token sync ran, the build passed, and nobody caught the breaking change.

Design variables change like APIs, but we don't version them like APIs. There's no impact signal, and engineering has no way to know whether a token update is safe to pull or will break half the app.

Tokens as a versioned contract

SemVer gives designers and engineers one vocabulary for change. A contract is a typed payload with a schema version and a contract version, and the contract version tells teams whether a change is safe, risky, or breaking.

json
{
  "contractVersion": "1.4.0",
  "schemaVersion": "2025.10",
  "source": "design",
  "publishedAt": "2026-01-15",
  "tokens": {
    "color.brand.primary": {
      "type": "color",
      "value": "#4ea1ff"
    }
  }
}

Release rules

ChangeVersion bumpExample
Rename or remove tokenMAJORcolor.brand.primary → color.brand.main
Change token typeMAJORspacing.md from string to number
Add new tokenMINORNew color.brand.tertiary
Adjust value onlyPATCH#4ea1ff → #3d9aff

Detecting breaking changes

Nobody picks the version bump by hand. It's computed from the diff:

ts
type BreakingChange = {
  token: string
  reason: 'removed' | 'renamed' | 'type_changed'
  previous: TokenDefinition
}

function detectBreakingChanges(
  previous: TokenContract,
  next: TokenContract,
): BreakingChange[] {
  const breaking: BreakingChange[] = []

  for (const [key, def] of Object.entries(previous.tokens)) {
    if (!(key in next.tokens)) {
      breaking.push({ token: key, reason: 'removed', previous: def })
    } else if (next.tokens[key].type !== def.type) {
      breaking.push({ token: key, reason: 'type_changed', previous: def })
    }
  }

  return breaking
}

function computeVersionBump(
  previous: TokenContract,
  next: TokenContract,
): 'major' | 'minor' | 'patch' {
  const breaking = detectBreakingChanges(previous, next)
  if (breaking.length > 0) return 'major'

  const newTokens = Object.keys(next.tokens).filter(
    (k) => !(k in previous.tokens),
  )
  if (newTokens.length > 0) return 'minor'

  return 'patch'
}

CI integration

This runs in the design token publish pipeline. If the computed bump is major, the pipeline requires explicit approval before tokens sync to code.

bash
#!/bin/bash
# token-publish.sh

BUMP=$(pnpm vds-cli diff --previous tokens.v1.json --next tokens.v2.json)

if [ "$BUMP" = "major" ]; then
  echo "⚠️  Breaking change detected. Requires approval."
  gh pr comment --body "This token update contains breaking changes. \
    Review required before sync."
  exit 1
fi

pnpm vds-cli publish --bump "$BUMP"

What versioning gets you

Once tokens are versioned like code, every change has a diff you can audit, CI checks compatibility before anything syncs, and you can roll back to the last known-good version. Impact is described in version numbers every team already knows how to read. Drift turns into a release cycle you can plan around, with the contract enforced in the pipeline.

This is part of the Variable Design Standard, the spec I'm working on to bring infrastructure-style versioning and checks to the handoff between design and engineering.