W3C Design Tokens (DTCG 2025.10): Figma Variables to CSS
Structure vendor-neutral color tokens with W3C DTCG 2025.10 JSON ($type, $value colorSpace & components), aliases, and export to CSS & Tailwind v4.
Summary
| Format | Color Value Representation | Wide-Gamut Safe | Alias Support |
|---|---|---|---|
| Legacy Tokens JSON | "value": "#2563EB" | No (sRGB only) | Tool-specific |
| W3C DTCG 2025.10 | "$type": "color", "$value": { colorSpace, components } | Yes (oklch, display-p3) | Standard {group.token} syntax |
| CSS Custom Properties | --color-brand: oklch(54.6% 0.215 262.9) | Yes | var(--color-brand) |
Anatomy of a W3C DTCG 2025.10 color token
Under the 2025.10 specification, tokens carry a dollar-prefixed $type of "color" (either directly or inherited from a parent token group) and a structured $value payload specifying colorSpace, numeric components array, optional alpha, and fallback hex.
This resolves decades of ambiguity when moving Display P3 or OKLCH values between design apps and mobile/web compilers.
- colorSpace accepts standard W3C identifiers including srgb, oklch, oklab, and display-p3.
- Semantic alias tokens point to primitive tokens cleanly via curly-brace references.
Example 2025.10 color object exported to CSS variables
Below is a compliant DTCG 2025.10 token tree preserving exact OKLCH components alongside a human-readable hex preview for tooling compatibility.
JSON{
"color": {
"$type": "color",
"brand": {
"primary": {
"$value": {
"colorSpace": "oklch",
"components": [0.546, 0.215, 262.9],
"alpha": 1,
"hex": "#2563eb"
}
}
}
}
}Extracting CSS themes back into DTCG JSON
Already maintain colors inside existing CSS custom properties or SCSS maps? Extract and normalize them directly into valid DTCG JSON in browser memory with zero CLI setup.
Export clean token files straight into Git repositories or Figma plugin importers.
- Automatically normalizes Hex, RGB, HSL, and OKLCH inputs into unified JSON.
- Outputs CSS :root blocks, Tailwind @theme files, SwiftUI, and Android XML side by side.
Tools featured in this guide
Related formats
Frequently asked questions
Can legacy $value string hex tokens still be parsed?
Yes — Colr's DTCG converter accepts both legacy flat Hex/RGB token strings and 2025.10 structured color objects.
Does DTCG support dark-mode token aliases?
Yes, semantic theme tokens reference primitive color paths like {color.brand.500} across theme files.
Authoritative Specifications & References
More color guides
- Hex to OKLCH: Migrating Design Tokens to Tailwind CSS v4Step-by-step guide to upgrading Hex and HSL Tailwind v3 themes into CSS Color 4 @theme oklch() scales with perceptual brightness and Display P3 support.
- Converting Adobe .ASE, .ACO, Procreate .swatches & GIMP .gplLearn the binary differences between Adobe .ase, Photoshop .aco, Procreate .swatches ZIP, and GIMP .gpl — and convert between them locally in the browser.
- Convert CSS hex alpha to Android ARGBMove the alpha byte from the end of a CSS hex color to the front of an Android color resource. Check the result with a translucent blue test swatch.
- Repair a GIMP GPL palette that imports emptyRepair a GIMP GPL palette by checking its header and RGB rows. Use a two-swatch reference file to isolate missing colors and verify the imported values.