Design System: primitive and semantic tokens

Design System: primitive and semantic tokens

Design System: primitive and semantic tokens

When building a design system, the first aspect to consider is scalability. Scalability involves the ability to easily expand while also maintaining control. It's precisely for the sake of scalability that design tokens were created.

When building a design system, the first aspect to consider is scalability. Scalability involves the ability to easily expand while also maintaining control. It's precisely for the sake of scalability that design tokens were created.

When building a design system, the first aspect to consider is scalability. Scalability involves the ability to easily expand while also maintaining control. It's precisely for the sake of scalability that design tokens were created.

Riccardo Marconato

Sep 12, 2023

Riccardo Marconato

Sep 12, 2023

Riccardo Marconato

Sep 12, 2023

When building a design system, the first aspect to consider is scalability. Scalability involves the ability to easily expand while also maintaining control. It's precisely for the sake of scalability that design tokens were created.

A definition of Design Tokens:

Design tokens are named entities that store raw, indivisible design values like colors or sizes. They are the fundamental components of a design system. Stored in a technology-agnostic format, they can be adapted for use on any platform, replacing hard-coded values.

An example:

red = #FF2800

In a design application like Figma or any other similar app, applying the RED token to any element will result in the following color being applied.

This is considered a design decision: red is this red. Of course, there are millions of other possible shades of red you could have selected. I've already written another article about Design Tokens, which I encourage you to check out if the definition of Design Tokens is still unclear to you.

The token we've just used is considered a Primitive Design Token, but there are also Semantic Design Tokens. What's the difference between the two? What distinguishes a Primitive Design Token rom a Semantic Design Token?

Let's explore them together.

What are Primitive Tokens

Primitive tokens are foundational elements within a design system. They serve as the fundamental building blocks, encapsulating core design values such as colors, typography, spacing, and more.

red = #FF2800
green = #52FF00
border-radius = 8px
sans-serif-font = Inter
serif-font = Times
display-font = Roobert

These tokens are raw and indivisible, representing the essence of the design system's aesthetics. Their purpose lies in providing consistency and maintainability to a project's design language.

By using primitive tokens, designers and developers ensure that the same visual characteristics are consistently applied throughout the entire product, across various platforms and devices. This not only streamlines the design and development process but also facilitates easy updates and maintenance, ultimately resulting in a cohesive and harmonious user experience.

Now, everyone using the same design system is in agreement because they know that when they use the RED token, it's precisely what we've decided, which is #FF2800, and nothing else.

What are Semantic Tokens

Semantic tokens are an integral part of a design system, complementing the primitive tokens. While primitive tokens handle the foundational design elements, semantic tokens add a layer of meaning and context to these elements. They encompass design values with semantic significance, like primary buttons, secondary buttons, card backgrounds, and more.

For example:

button-background = $red
button-font = $sans-serif-font

Note that we used a primitive token as value. Semantic tokens have the unique capability to store not only primitive tokens but also other semantic tokens. This flexibility allows them to represent complex design hierarchies and relationships (alias), creating a comprehensive and adaptable framework for your design system.

Unlike primitive tokens, semantic tokens aren't just about colors and dimensions; they carry the purpose and role of specific design elements. They define how these elements should look and behave in different contexts within your product.

The significance of semantic tokens lies in their ability to communicate design intent effectively. They ensure that everyone working with the design system understands the specific use cases and meaning behind each token, promoting consistency and clarity in design decisions.

By incorporating semantic tokens, designers and developers can streamline collaboration and maintain a shared understanding of the design system's purpose. This, in turn, leads to a more cohesive and user-friendly experience for all users of the product.

Differences between Primitive Tokens and Semantic Tokens

Primitive Design Tokens:

  1. Foundational Elements: Primitive tokens serve as foundational building blocks, focusing on basic design values like colors, typography, spacing, and more.

  2. Raw Values: They store raw and indivisible design values. For instance, "red" = "#FF2800."

  3. Aesthetics: Primitive tokens represent the core aesthetics of the design system, providing the visual style.

  4. Consistency and Maintainability: Their primary purpose is to ensure visual consistency and maintainability throughout a project.

  5. Simplified Usage: Using primitive tokens simplifies the design and development process, promoting a cohesive user experience.

Semantic Design Tokens:

  1. Layer of Meaning: Semantic tokens add meaning and context to design elements, going beyond raw aesthetics.

  2. Semantic Significance: They encompass design values with semantic significance, like "primary buttons" or "card backgrounds."

  3. Alias Capability: Semantic tokens can store not only primitive tokens but also other semantic tokens, allowing for complex design hierarchies (alias).

  4. Contextual Behavior: They define how design elements should appear and behave in different contexts within a product.

  5. Effective Communication: Semantic tokens effectively communicate design intent, promoting consistency and clarity in design decisions.

  6. Enhanced Collaboration: By incorporating semantic tokens, designers and developers can streamline collaboration and maintain a shared understanding of the design system's purpose.

In essence, Primitive Design Tokens provide the basic aesthetics, while Semantic Design Tokens add layers of meaning and context, making them versatile for comprehensive design systems.

ABOUT THE AUTHOR

Riccardo Marconato

Creative Designer specializing in Product Design and Design Systems. Over 10 years of experience, multiple awards, and international project contributions.

ABOUT THE AUTHOR

Riccardo Marconato

Creative Designer specializing in Product Design and Design Systems. Over 10 years of experience, multiple awards, and international project contributions.

ABOUT THE AUTHOR

Riccardo Marconato

Creative Designer specializing in Product Design and Design Systems. Over 10 years of experience, multiple awards, and international project contributions.

Read More