Systems · 15 min read ·

Name tokens for what they do

Call it brand-primary and you will rename four hundred references next year.

Design tokens often look like a colour and type list. The real issue is naming. Names like brand-primary, blue-600 or accent-2 bake today’s brand decision into code. When the brand changes (and it will), hundreds of references get renamed. Worse: nothing is touched and the system cracks between two identities. I watched one client site go through two rebrands in three years. The first pass searched brand-orange across three hundred files. The second pass searched nothing; only new screens bound to the new purple palette. Old pages stayed orange. A user asked if two companies lived on the same domain. The answer was no. The naming was wrong. Role-based naming I name a token for the job it does, not the colour it happens to be. surface-default, ink-primary, action-primary, border-subtle, danger-fg. The colour value can change; the role stays. That is the approach that survives three rebrands. Layers Primitives first: raw values like palette-teal-600. Then semantic roles: action-primary → palette-teal-600. Then component bindings: button-primary-bg → action-primary. If components bind straight to the palette, every button becomes its own decision. The semantic layer gives one place to steer. I apply the same rule to spacing and type. space-card-padding, type-body, type-display. Hard-coding “16px” or “Inter-Bold” recreates the same mess when brand type changes. Anti-patterns from real files brand-orange-hover: brand and state in one name. Nobody owns hover; dark theme arrives, orange hover becomes unreadable, and every screen gets a one-off fix. gray-3: ordinal numbers carry no meaning. The gap between gray-3 and gray-4 becomes team mythology. “A bit lighter grey” turns into three Slack messages. special: everything special stops being special. Within two months you get special-2 and special-hotfix. Dark theme Semantic roles map to different primitives in light and dark. Component code does not know the theme; it knows tokens. “Accent broke in dark” becomes a table fix, not a screen-by-screen hunt. I keep contrast checks in the same table: if action-primary in dark falls under the WCAG threshold, the primitive changes, not the component. Practical rule Before I add a token I ask: will this name still be true after a brand change? If no, the name is wrong. I ask the same question in PR review. A “temporary” brand-new-blue becomes permanent in six months. One page of documentation is enough: which roles exist, which primitives they map to, who approves changes. When Figma variables and code tokens share the same names, the handshake ends. Two sources with different names produce silent drift. A token system is not a style-guide decoration. It is a vocabulary that survives change. When the vocabulary breaks, every screen speaks a different language.

Back

Send the brief