primitive / docs / tokens / overviewgraph live / 16 tokens bound

Name things once.

token-graph.json / three layers
primitive
semantic
component
brand-500 oklch(.70 .12 183)
Get started Read the docs beta

A school for design tokens. One value lives in one place, gets a name that says what it is for, and flows through every button, brand and platform. Drag the hue and watch the change travel down the wires.

  • 3layers
  • 1source of truth
  • 6themes, zero forks
01 / anatomyscrubbed by scroll

Three layers.

A button with four hard-coded values is four decisions nobody can find again. Scroll to take it apart.

  1. hardHard-coded. Hex and pixel values pasted straight into the button. Change the brand and you hunt through every file.
  2. componentComponent tokens name each decision for this button only: button-bg, button-radius.
  3. semanticSemantic tokens say what a value is for, across the product: color-action-primary.
  4. primitivePrimitive tokens hold the raw palette and scales. Named once, they never say where they are used.

Book a demo
background: #14b8a6;
color: #062b27;
border-radius: 8px;
padding: 12px 20px;
component button-bg button-text button-radius button-padding
semantic color-action-primary color-text-on-action radius-control space-inset-md
primitive teal-500 #14b8a6 teal-950 #062b27 radius-2 8px space-3 12px space-5 20px
layer 0 / 34 values, 0 names
02 / theming / multi-brand

One system, three brands.

semantic
primitive pool
brand fernhill / mode light5 aliases re-routed
03 / namingscramble on enter

Names are the interface.

anatomy of a semantic name
color.action.primary.hover
categoryWhat kind of value: colour, space, font.
conceptThe job it does: action, surface, feedback.
variantWhich one: primary, subtle, danger.
stateOptional: hover, pressed, disabled.
  1. Name the purpose, not the value. blue-2 breaks the day the brand turns green.
  2. Primitives describe, semantics decide. teal-500 is a fact; color-action-primary is a choice.
  3. Aliases point one way. Components read semantics, semantics read primitives, never the reverse.
    04 / design to codeone token, four places

    From the canvas to the codebase.

    01 / design tool variable
    action/primary
      light  {teal/500}
      dark   {teal/400}
    02 / tokens.json (W3C)
    "action": { "primary": {
      "$type": "color",
      "$value": "{teal.500}" } }
    03 / build transform
    resolve aliases
    convert oklch to hex
    emit css, swift, kotlin
    04 / shipped
    --color-action-primary:
      #14b8a6;
    Color.actionPrimary
    R.color.action_primary
    05 / practisetwo tools

    Now make your own.