Skip to content

Design System

Design Tokens: The Foundation of Modern Design Systems

8 min read
Designer explaining concepts at a whiteboard

What if you could change a single variable and have your entire product — from the smallest badge to the hero section — update automatically? That’s exactly what design tokens deliver.

What are design tokens?

Design tokens are the atomic building blocks of a design system. They store visual decisions — colors, font sizes, spacing, border radii, shadows — as named variables rather than hard-coded values.

Instead of color: #0f0f0f you write color: hsl(var(--foreground)). Instead of font-size: 14px you use text-body-sm. The benefit: the concrete value is defined in a single place and can be changed at any time.

Design tokens are the API between design and code. They are the contract that ensures both sides speak the same language.

Why tokens instead of variables?

CSS custom properties have existed for years. What makes design tokens different? The difference isn’t in the technology — it’s in the semantics.

A variable like --gray-500 describes a value. A token like --muted-foreground describes an intent. That intent stays the same even when the concrete value changes — for example when switching from light to dark mode.

The three-layer model

A mature token system has three tiers:

  1. Primitive tokens — The raw values: --gray-50 through --gray-950
  2. Semantic tokens — The meaning: --background, --foreground, --muted
  3. Component tokens — The context: --card-bg, --btn-primary-bg

ABSTRAKT primarily uses the first two tiers. Component tokens are used sparingly because they add complexity without proportional benefit.

Tokens in practice

A concrete example: our color system defines --background: 0 0% 98% in light mode and --background: 0 0% 5.9% in dark mode. Every component that uses bg-background switches automatically — without changing a single line of code.

The same principle applies to typography. Our scale from text-body-xs to text-display-xl defines not just font sizes, but also line heights and letter spacing. One token, three values, always consistent.

Dark mode without effort

The biggest practical advantage of semantic tokens shows up in dark mode. Instead of writing hundreds of classes with dark: prefixes, you update the token definitions:

.dark {
  --background: 0 0% 5.9%;
  --foreground: 0 0% 96%;
  --muted: 0 0% 12%;
}

Done. Every component built on these tokens works immediately in both modes.

Conclusion

Design tokens are not a technology — they are a way of thinking. They force you to make design decisions consciously, name them, and document them. The result: fewer inconsistencies, faster iteration, and a system that grows with your product.

In ABSTRAKT, tokens are the foundation of everything. From the smallest border to the most complex section — every visual value has a name, a meaning, and a single place where it is defined.