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.

6 min read · Updated 2026-11-22

Summary

FormatColor Value RepresentationWide-Gamut SafeAlias 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)Yesvar(--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.

Convert DTCG JSON <-> CSS & Tailwind

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.

Example 2025.10 color object exported to CSS variables
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.

Extract CSS colors to Design Tokens

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.

More color guides