| description | Use when structuring a design-token system for a web app or component library, authoring the JSON interchange file per the W3C Design Tokens Community Group format, emitting tokens as CSS custom properties, deciding whether a value belongs at the primitive / semantic / component tier, registering an animatable token via `@property`, wiring up runtime theme switching via `data-theme` attribute or `color-scheme`, or migrating a codebase off hardcoded hex / rgb / oklch literals. Prevents the most common token-system regressions in 2026 : hardcoded color literals scattered across components so a brand refresh requires a twelve-file PR, single-tier flat tokens that map `--color-blue-500` directly to a button background and break the moment the brand picks a new blue, tokens declared in the default cascade layer that get overridden by random component CSS, a transitioned custom property that does not animate because it was never registered via `@property`, raw token names like `--my-bg` that leak into application styles, JSON files that invent their own shape and require rewriting when migrating to a real DTCG-aware tool, and shipping the experimental DTCG draft without disclosing its not-production-ready status. Covers the DTCG Design Tokens Format Module 2025.10 draft (JSON shape, required `$value`, required `$type`, optional `$description`, optional `$extensions` vendor metadata under reverse-DNS keys), the seven base types (`color`, `dimension`, `fontFamily`, `fontWeight`, `duration`, `cubicBezier`, `number`) plus the six composite types (`border`, `shadow`, `transition`, `strokeStyle`, `gradient`, `typography`), the alias syntax `{group.subgroup.token}` that resolves to target `$value`, the three-tier chain (raw brand to primitive to semantic to component), the CSS emission rules (custom properties under `@layer tokens`, `@property` registration for typed and animatable tokens, `light-dark()` for theme-aware swaps, `data-theme` attribute for explicit user override), and the rule that production today MUST transform DTCG JSON via a build pipeline (Style Dictionary, Tokens Studio, or equivalent) because the spec is explicitly NOT production-ready. Keywords: design tokens, DTCG, design tokens community group, W3C, designtokens org, $value, $type, $description, $extensions, alias, primitive token, semantic token, component token, three-tier tokens, CSS custom properties, custom property, var, @property, color, dimension, fontFamily, fontWeight, duration, cubicBezier, number, border, shadow, transition, strokeStyle, gradient, typography, light-dark, color-scheme, data-theme, @layer tokens, Style Dictionary, Tokens Studio, hardcoded hex everywhere, brand change painful, design system fragmented, no single source of truth for colors, theme broken at runtime, magic numbers everywhere, tokens drift, theme switch flashes, what are design tokens, how do I structure design tokens, three-tier token chain, DTCG W3C draft, design tokens to CSS, how to organize CSS variables, how to theme an app
|