By Alain Ngeukeu6 min read1314 words

Design Tokens: The Foundation of a Scalable UI

Table of Contents

  1. What is a Design Token?
  2. Three Reasons to Use Design Tokens
  3. Why Not Just Use Tailwind's Built-in Classes Directly?
  4. Utility Classes vs. Design Tokens
  5. The Most Common Tokens Teams Define
  6. Conclusion

1. What is a Design Token?

The very first website I built did not have any design tokens, and it was a big mistake. Design tokens are important even when vibe coding.

A design token is a named value that defines a specific design parameter in your project. These parameters can include color, spacing, typography, border radii, and responsiveness rules. The main purpose of a design token is to serve as the single source of truth for your frontend design. As a frontend developer, I see design tokens as the foundation of a scalable UI system because they separate design decisions from component code.

That definition sounds abstract on its own, so let's look at the three concrete reasons why that principle actually matters in practice.


2. Three Reasons to Use Design Tokens

Centralization of the Design Language

To centralize means to put everything in one place. When you want to modify or maintain a value, that change happens in exactly one location. Having several sources of truth makes the project harder to maintain, more time-consuming to update, and more likely to introduce visual inconsistencies over time.

Colors, spacing, typography, and radii are defined once as tokens. Components reference those tokens instead of hardcoded values. When the design team updates a color or spacing rule, the change propagates across the entire application automatically.

User Interface Consistency

The human eye detects inconsistencies quickly. By inconsistency, I mean irregular padding on the same button appearing in different locations, or different fonts scattered across the project. These issues hurt the project's aesthetic and lead to poor UX. Without tokens, developers tend to reach for slightly different values, such as blue-500 in one file and blue-600 in another, or a custom hex code somewhere else entirely. Tokens enforce a single source of truth for visual styles, which keeps the product visually coherent.

Scalability and Team Collaboration

With tokens, switching themes, such as dark mode, brand variants, or white-label products, becomes straightforward because you only swap the token values while components remain unchanged.

Tokens also improve collaboration between designers and developers. Designers define tokens in the design system (often in tools like Figma), and developers consume the same tokens in code. This creates a shared vocabulary: color-primary, spacing-md, radius-lg. Everyone speaks the same language, regardless of which side of the design-to-code handoff they sit on.

Understanding why tokens matter is one thing. Understanding why Tailwind's utility classes alone do not replace them is another.


3. Why Not Just Use Tailwind's Built-in Classes Directly?

This is question , I got ask . Tailwind's built-in classes like text-blue-500 or rounded-md are generic. They work fine for small projects, but they carry no meaning about your specific design decisions.

Say your brand primary color is blue. You scatter text-blue-500 and bg-blue-500 across 50 components. Then your client says the brand color is changing to purple. You now have to hunt through every file and replace every blue-500 manually, hoping you missed nothing.

// Without design tokens — blue-500 is hardcoded everywhere <button className="bg-blue-500 text-white">Submit</button> <a className="text-blue-500 underline">Learn more</a> <div className="border-blue-500">Card</div>

The fix is to define your design tokens once in tailwind.config.ts (assuming Tailwind CSS v3):

// tailwind.config.ts theme: { extend: { colors: { primary: '#3B82F6', // your brand blue today danger: '#EF4444', muted: '#6B7280', }, borderRadius: { md: '8px', lg: '12px', } } }

Now your components use semantic names instead of raw values:

// With design tokens — meaning is clear, value is centralized <button className="bg-primary text-white">Submit</button> <a className="text-primary underline">Learn more</a> <div className="border-primary">Card</div>

When the brand color changes to purple, you change one line in tailwind.config.ts and every component updates instantly. The class name bg-primary stays the same; only the value behind it changes.

That example illustrates the maintenance problem clearly, but there is a subtler issue worth unpacking: the difference between a class that names a color and a class that names a role.


4. Utility Classes vs. Design Tokens

Design tokens and utility classes are two different layers: one defines values, the other consumes them.

Think of it this way: utility classes like bg-blue-500 or text-lg are Tailwind's generic vocabulary. Design tokens are your project's specific vocabulary built on top of that.

/* You define what "primary" means for YOUR project */ @theme { --color-primary: #3B82F6; }
/* Then consume it with a semantic class */ <button className="bg-primary">Submit</button>

Without a design token, you would write:

<button className="bg-blue-500">Submit</button>

Both work. The difference shows up at scale. Imagine 80 components all using bg-blue-500 and your client changes the brand color. You have to find and replace in 80 files. With a token you change one line in globals.css and every component updates instantly because they all point to --color-primary.

The second reason is semantics. bg-blue-500 tells you the color. bg-primary tells you the role: this is the main brand color. Six months later when another developer reads your code, bg-primary is immediately meaningful in a way that bg-blue-500 is not. That said, for a small personal project, using utility classes directly is perfectly fine. Design tokens earn their setup cost once your project grows, gains multiple developers, or needs to stay visually consistent across many components.

With the concept settled, the next question is a practical one: what should you actually define as tokens when starting a project?


5. The Most Common Tokens Teams Define

Most teams converge on a practical 80/20 set of tokens that covers the majority of their design decisions.

Colors typically include brand, brand-foreground, background, foreground, surface or card, muted, muted-foreground, border, and semantic states such as success, warning, and danger.

Spacing tokens usually cover page (overall page padding), section (vertical spacing between major sections), stack (gap between items in a column), and gutter (horizontal container padding).

Radii are often defined per component type: card, button, and input each get their own token.

Shadows follow a similar pattern, with separate tokens for card, dropdown, and focus states.

Typography tokens typically include font-sans, font-heading, and optionally text-body, text-caption, and leading-body for fine-grained control over reading rhythm.

Breakpoints are often left at Tailwind's defaults (xs, sm, md, lg, xl) unless the project has a specific reason to rename them.

That list is a starting point, not a ceiling. The more important takeaway is the habit behind it.


6. Conclusion

Design tokens are not a framework or a library. They are a discipline. They represent the decision to name your design values instead of scattering raw numbers and colors across your codebase. Whether you are working solo or on a team, they give your project a backbone that makes it easier to maintain, easier to scale, and easier for anyone, including your future self, to understand at a glance.

Start with a small set of tokens covering color, spacing, and radii. You do not need to define everything on day one. The habit of reaching for a token instead of a hardcoded value is what matters most, and it is a habit that pays compounding returns as your project grows.

If you want to see how design tokens translate into actual code, this article walks through a practical implementation step by step: [your link here]

By Alain Ngongang