📐Component Token
Also known as Component-Specific Token, Component-Level Token
A token for one part, like button-background. It lets you change that part alone.
Think of it like
It is like a sticker on one toy box that says its color. Change that sticker, and only that box changes.
Example
The team wants buttons a bit darker than links. They point button-background at a new value, and the links stay the same.
Why it matters
It gives each part a safe handle. A change to one part cannot spill into the others by accident.
Definition
Example code
css
:root {
--color-primary: var(--blue-600);
--button-background: var(--color-primary);
}
.button { background: var(--button-background); }Common mistake
Key takeaways
- 1Belongs to one part. The name says which.
- 2Points to a semantic token. Not to a raw value.
- 3Add it when needed. Not for every value.