Naming

Naming is the convention that makes tokens, components, props, and variants predictable enough to guess — a structured grammar applied consistently across the system.

Why it matters

Names are the public API of a design system; you rename a token far less often than you read it, so the cost of a bad name compounds. A predictable grammar means a developer can guess color.text.disabled exists without searching, and a reviewer can spot btnColor2 as wrong on sight. Inconsistent naming is what turns a 400-token set into something only its author can navigate — the failure mode defining-design-tokens warns about.

How it works

Tokens use a fixed ordered grammar, most-general to most-specific:

category . property . variant . state
color.text.primary           color.bg.danger.hover
space.inset.sm               size.icon.lg
LayerConventionExample
Primitivescale by number, no intentblue.500, space.4
Semanticintent, never valuecolor.action, not color.blue
Componentcomponent.part.variant.statebutton.label.primary.hover
Boolean proppositive, no is-on-the-wiredisabled, not notEnabled

Standing rules:

  • Name by intent, not value or appearancecolor.danger, never color.red; the red can change, the role won’t.
  • Pick one casing per surfacekebab-case tokens, PascalCase components, camelCase props (see code-style).
  • No magic numbers in namesgrey3 hides meaning; grey.300 ties to the scale.
  • Singular, full wordscolor not colors or clr; abbreviations cost more than they save.

Example

A team renames $brandBlue, $blue2, and $accent — three names for one value — to the tier blue.500 (primitive) → color.action (semantic) → button.bg.primary (component). The first rebrand re-points color.action once; nothing referencing it changes. Compare the old world, where “which blue?” required reading every usage and a global find-replace that also hit unrelated blues.

Pitfalls

  • Encoding the valuecolor.blue / grey3 couples a name to today’s pixels and breaks at the next palette change.
  • Mixed grammarsbgColorPrimary next to color.bg.primary; pick one order and enforce it in review.
  • Abbreviationsbtn, clr, bg-pri save keystrokes and cost comprehension; spell it out except universally-known bg.
  • Index suffixes for meaningspacing-2 as “the medium one” breaks when you insert a value; map numbers to a real scale.

See also