Skip to content

Tokens

Every visual decision in Hypermedia Components flows through four layers:

  1. DTCG JSON sources — primitive, semantic, component, and theme token files are the single source of truth.
  2. A build step emits them as --hc-* CSS custom properties.
  3. The semantic classes (hc-button, hc-card, …) consume only those variables — never hard-coded values.
  4. Runtime axes — plain HTML attributes — re-resolve the variables, so one attribute restyles everything at once, with no rebuild.

Fundamentals · Tokens covers the layer model, the DTCG reference syntax, and variable naming in depth.

AxisValuesSet onDocs
data-themelight / dark<html>Light and dark
data-coloraccent theme — default, indigo, emerald, rose, amber<html>Color themes
data-neutralgray ramp — gray, slate, zinc, neutral, stone<html>Neutral ramps
data-densitycomfortable / compact / dense<html>Density
dirltr / rtl<html>Right-to-left

All five are orthogonal — set any combination. Each also works on any subtree, not just <html>, so a section can run dark or dense on its own.

Open the Theme builder, paste one brand color, and copy out a ready-to-paste CSS block (or the DTCG source). It runs the real token build in your browser and checks WCAG contrast live.