Skip to content

Tokens overview

helix-ui tokens are authored in the helix-ui-css-source-v1 legacy profile: DTCG-style metadata and aliases with CSS strings for literal values. The source files live in packages/tokens/tokens/:

  • core.json — primitive values (color ramps, spacing scale, radii, type, shadows). Not for direct use in components.
  • semantic.light.json — intent-based aliases. Components consume these. References primitives via {color.brand.500} syntax.
  • semantic.dark.json — same shape as light, different primitive references.

Token paths read as a sentence: <category>.<role>.<context>.<state>.

Path Reads as
color.bg.action.brand.default Background color, action role, brand context, default state.
color.bg.action.brand.hover …same, hover state.
color.text.on.brand Text color when placed on top of a brand fill.
color.border.focus Border color used for focus rings.
space.4 The 4-step on the spacing scale (16px).
radius.md Medium corner radius (8px).

In CSS the same paths become --helix-ui- prefixed kebab-case variables: color.bg.action.brand.default → --helix-ui-color-bg-action-brand-default.

primitive → semantic → component CSS
core.json semantic.*.json button.css

A component never reaches into core.json. It composes semantic tokens. This means:

  • Theming is alias swapping. Dark mode rebinds the same semantic names to different primitives.
  • Renaming a primitive does not break components. Only the semantic mapping changes.

Run pnpm build:tokens. Outputs:

  • dist/css/core.css — primitive CSS variables on :root.
  • dist/css/semantic.css — semantic CSS variables, themed via [data-theme="light"|"dark"].
  • dist/css/all.css — both, in order.
  • dist/index.{js,d.ts} — TypeScript types and a typed cssVar(path) helper.
  • dist/manifest.json — flat AI-readable manifest. One entry per token with value, type, description, layer, and per-theme resolutions.
  • dist/formats.json — the source profile and interchange version.
  • dist/dtcg/2025.10/{light,dark}.tokens.json — structured DTCG 2025.10 documents, each containing primitives and one semantic theme.
  • dist/dtcg/2025.10/report.json — coverage and excluded source values.

For DTCG 2025.10, use the package exports @helix-ui/tokens/dtcg/2025.10/light.json and dark.json. The existing raw tokens/*, CSS, TypeScript, manifest, and Tailwind exports retain their established values and shape.

The typed export preserves paths, descriptions, and aliases while converting CSS literals into the standard’s structured values. Each theme currently exports 143 of 146 tokens. The three font.tracking.* values use em; DTCG 2025.10 dimensions allow px and rem, so the report lists these exclusions with their original values. No font-size context is assumed.

Interchange files represent the authored base values. Runtime DNA changes and mobile CSS scaling are separate. Local structural and alias checks do not establish a particular design tool’s import or roundtrip compatibility; see the Figma import guide for the checks to perform.

The explicit build pipeline makes token-to-CSS behavior inspectable and keeps the existing consumer outputs stable. A separate exporter provides the versioned interchange view. This allows the authored CSS-value profile and external structured token format to evolve independently.