Lesson 7 of 30
A hardcoded hex value is a decision made once and repeated by hand forever. A token is that same decision named and centralized — the difference between a color and a system.
13 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
What's the difference between a primitive token and a semantic token?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
A design token is a named, centralized value standing in for a raw design decision — a color, a spacing value, a font size, a radius. Instead of every component writing background: #00d89d, every component writes background: var(--color-accent), and one file decides what --color-accent actually is.
The reasoning trio from the last three lessons — type scale, spacing scale, color — are exactly what tokens are for. A scale is a set of related values; a token is the name that lets a component reach for one of those values without knowing or caring what it currently resolves to.
Most real systems split tokens into layers:
--p-neutral-950: #0a0b0e).--color-bg: var(--p-neutral-950) — "this primitive is now the page background").A primitive token: a raw value with no meaning attached yet — just a color.
This platform's own globals.css is a real, live instance of exactly this structure — and it's not an accident that "components consume ONLY semantic + track tokens, never primitives" is written into this codebase as an enforced rule, not a suggestion. A component that reached past the semantic layer straight to --p-jade-500 would still work today — and would silently stop tracking any future retheme, because the semantic layer is the only thing anyone promises to keep updated.
/* Primitive: a raw value, no meaning yet */
--p-jade-dark: #00d89d;
/* Semantic: the primitive given a role */
--color-accent: var(--p-jade-dark);
/* Component consumes the role, never the primitive */
.button { background: var(--color-accent); }
--z-modal token prevents the same "what number is safely above everything else" guessing game that untamed hex values create for color.--color-accent equals. Tokens don't make design decisions disappear; they make each decision get made exactly once, in exactly one place, instead of once per component."How would you handle a rebrand that changes the primary color?" is a real, common systems-thinking question. "Find every hex value and replace it" is the answer of someone who hasn't used tokens. "Update the semantic accent token once" is the answer of someone who has — and it's a difference interviewers specifically listen for.