Colours, spacing and type scales are just decisions. Turn them into tokens and your whole interface gets faster to build and easier to change.
What a design token actually is
A design token is a named design decision. Instead of writing the same hex colour or pixel value in fifty places, you give it a name like color-accent or space-4 and use that name everywhere. When the decision changes, you update one value and the entire interface follows. It is a small idea with a big effect on consistency.
Start with three layers
A simple structure works best. Primitive tokens hold raw values, like a purple-500 colour or an 8px unit. Semantic tokens give those values meaning, like color-accent or text-muted. Component tokens apply them to specific parts, like button-background. Most projects only need the first two layers, so start there and add the third only when you feel the need.
CSS custom properties do the heavy lifting
You do not need a heavy toolchain to use tokens. CSS custom properties defined on the root element are enough for colour, spacing, radius, shadows and type sizes. They cascade, they can be overridden inside any component, and they update live in the browser. That makes them perfect for theming and for quick experiments in DevTools.
Dark mode becomes almost free
When components use semantic tokens instead of fixed colours, a dark theme is just a second set of values for the same names. Swap the values with a data attribute or the prefers-color-scheme media query and nothing else changes. If dark mode feels painful in your project, it is usually a sign that raw colours are leaking into components.
Build a spacing and type scale
Random values make an interface feel slightly off, even when people cannot say why. Pick a spacing scale based on a small unit, such as 4px, and use only multiples of it. Do the same for font sizes with a consistent ratio. Fewer choices mean faster decisions, and the layout gains a quiet rhythm that feels considered.
Keep design and code in sync
Tokens work best when designers and developers share the same names. Export your tokens from the design tool, or define them in a single JSON file and generate the CSS from it. When a name in Figma matches a variable in code, handoff conversations get shorter, and fewer small mismatches slip into production.
Common mistakes to avoid
Do not create a token for every single value, or the system becomes noise. Do not name tokens after their appearance, like blue-button, because the colour will change one day. Name them after their purpose instead. And do not skip documentation, because a token nobody understands will quickly be bypassed with a hard-coded value.
Small system, big payoff
A good token set takes an afternoon to build and saves hours on every project that follows. Your interface becomes more consistent, theming becomes simple and changes stop being scary. Start small with colour, spacing and type, and let the system grow only as your real needs appear.

Written by
Sabur Ahemad Khan
Creative Frontend & 3D Developer
I write about shaders, motion, and shipping immersive sites that stay fast.
