Figma & Design Tokens
Figma Variables and W3C Design Tokens (tokens.json / Tokens Studio) store machine-readable primitives, while DESIGN.md adds the prose judgment and negative constraints that AI coding agents need to assemble real pages.
Mapping Figma concepts to DESIGN.md
| Figma concept | DESIGN.md equivalent |
|---|---|
| Color Variables (Light / Dark) | colors and colors.dark.* hex tokens |
| Number Variables (Radius) | rounded (sm, md, lg, full) |
| Number Variables (Spacing) | spacing (xs, sm, md, lg, xl) |
| Text Styles | typography entries (fontFamily, fontSize, fontWeight, lineHeight, letterSpacing) |
| Component specs & usage notes | components YAML properties + ## Components prose |
| Design critique & brand rules | ## Overview, ## Voice & Content Strategy, ## Do's and Don'ts |
Bridging DTCG tokens.json into DESIGN.md
If your design team exports W3C DTCG JSON from Figma or Tokens Studio:
{
"color": {
"primary": { "$type": "color", "$value": "#4338ca" },
"surface": { "$type": "color", "$value": "#f6f5f4" }
},
"dimension": {
"radius-md": { "$type": "dimension", "$value": "8px" }
}
}Translate the flattened token keys into DESIGN.md frontmatter and attach the human rationale that JSON strips away:
---
version: alpha
name: Product Design System
colors:
primary: "#4338ca"
surface: "#f6f5f4"
background: "#ffffff"
text: "#18181b"
rounded:
md: 8px
---
## Colors
- **Primary (`#4338ca`):** Primary actions and focus rings only.
- **Surface (`#f6f5f4`):** Card and sidebar background on top of white `#ffffff` canvases.Choosing a single source of truth
Avoid editing tokens manually in three places (Figma, tokens.json, and DESIGN.md):
- Design-driven teams: update Figma Variables, export or sync primitive values into
DESIGN.mdYAML frontmatter on a release branch, keep the##prose sections manually maintained in git, and runnpx @google/design.md diff+lintin PR review. - Code-driven teams: treat
DESIGN.mdin git as the source of truth, generate Tailwind v4 / CSS Variables / shadcn themes from it via DesignMD Pro’s code generators, and sync major releases back to Figma.
Verifying synced updates
Whenever Figma updates land in DESIGN.md:
-
Validate reference integrity and contrast in the Validator or with
npx @google/design.md lint DESIGN.md. -
Inspect exact token changes before merging:
npx @google/design.md diff origin/main:DESIGN.md DESIGN.md
Next steps
- Token Naming — align Figma variable names with
DESIGN.mdcontrast and codegen heuristics - Versioning & Revisions — track design updates across releases
- Tailwind CSS & shadcn/ui Integration — export tokens back into CSS
Last updated on