Naming design tokens: the art of clarity and consistency (2024)

Design tokens act as reusable pieces of code that describe colors, typefaces, spacing, and other visual elements in a design system. Choosing the proper names for your design tokens is critical for maintainability, clarity, and efficiency, just like naming variables in programming.

Naming design tokens: the art of clarity and consistency (3)

Effective design token names offer several benefits:

  • Clarity: A well-named token communicates its purpose and function immediately, reducing confusion and uncertainty for designers and developers.
  • Consistency: Consistency in naming patterns makes the design system easier to navigate and understand, increasing efficiency and reducing errors.
  • Maintainability: Clear and straightforward names enable updating and evolving the design system easier over time.
  • Collaboration: When design and development teams share a common understanding of token names, it promotes better communication and collaboration.
Naming design tokens: the art of clarity and consistency (4)

Several typical naming patterns might assist you in successfully organizing and naming your design tokens. They do, however, discuss what, where, and how the token is utilized.

1 Category-based (what): Tokens in this pattern are organized according to their functional category, such as colors, fonts, spacing, or shadows:

  • color-primary: The main color of your brand, used for logos, buttons, and important elements.
  • font-body: The standard font for body text, used in paragraphs and headings.
  • spacing-sm: A small amount of space between elements, often used for padding or margins.
  • shadow-card: A subtle shadow applied to cards to create depth and separation.

2 Component-based (where): Tokens are named in this pattern based on the exact component to which they apply. like:

  • button-primary-background: The background color of a primary button in its default state.
  • card-header-title: The font size and weight for the title in a card header.
  • navigation-link-active: The color of a navigation link when it's currently active.
  • input-error: The color and border style used to highlight an error in a form input field.

3 Modifier-based (how): Modifiers are used in this pattern to identify differences within a category or component. like:

  • color-primary-hover: The slightly lighter shade of the primary color used when hovering over a button or element.
  • font-body-bold: A bold version of the body font, used for emphasis.
  • spacing-sm-top: Applies the small space only to the top margin of an element.
  • shadow-card-hover: A slightly stronger shadow applied to a card when hovering over it.
Naming design tokens: the art of clarity and consistency (5)

Here are some key principles to consider when naming your design tokens:

  • Be descriptive: Use names that are specific and informative, reflecting the token’s purpose and value. Avoid using generic phrases such as “color1” or “spacing2.”
    Bad: color1
    Good: brand-primary ✅
  • Make use of context: Include context about the token’s usage, such as the component to which it applies or its role in the design system.
    Bad: font-large
    Good: heading-xl ✅
  • Keep it brief: Aim for names that are brief and memorable, as well as easy to type and read. Avoid names that are too long or too complicated.
    Bad: border-width-slightly-raised
    Good: border-raised ✅
  • Maintain consistency: Maintain a consistent naming scheme throughout your design system. This involves employing comparable tokens with the same prefixes, separators, and word order.
    Bad: color-button-active / active-button-color
    Good: button-primary-active ✅
  • Consider the big picture: Think about how your token names will scale as your design system expands. Use names that are specific to a project or component as little as possible.
    Bad: hero-banner-background (specific to one component)
    Good: background-hero (more reusable)
Naming design tokens: the art of clarity and consistency (6)
  • Use real words: Avoid using abbreviations, symbols, or jargon that may not be universally understood.
    Bad: btn-err (abbreviation for "button error")
    Good: button-error-state (clear and explicit)
  • Start with the basics: Name core tokens like primary colors and fonts first, then expand to more specific tokens.
    First: color-primary, font-body, spacing-sm
    Later: button-primary-hover, card-header-title, shadow-subtle
  • Document your naming system: Clearly document your chosen naming pattern and principles to ensure consistency across the team.
    Categories: colors, fonts, spacing, shadows
    Subcategories: buttons, cards, headings, inputs
    Modifiers: active, hover, error, disabled

Examples of Effective Design Token Names

color-brand-primary, font-heading-xl, spacing-card-margin, button-primary-disabled, navigation-link-hover-underline

Naming design tokens: the art of clarity and consistency (7)

When naming your design tokens, alongside clarity and descriptiveness, you’ll need to decide on a consistent case convention for your naming scheme. This seemingly small detail can impact the overall readability and maintainability of your design system. You have to collaborate with developers to use the code friendly case, which is most likely camelCase or underscore_case. Let’s explore the different options for token case naming:

Each word starts with a capital letter, with no separators.
Example: PrimaryColor, CardHeaderText, ButtonHoverState.

👍 Pros:

  • Easily readable, especially for longer names.
  • Commonly used in programming languages, making it familiar to developers.

👎 Cons:

  • Can appear visually heavy and blocky.
  • Not as intuitive for non-technical audiences.

Similar to PascalCase, but the first word starts with a lowercase letter.
Example: primaryColor, cardHeaderText, buttonHoverState.

👍 Pros:

  • Slightly less visually imposing than PascalCase.
  • More common in design circles and documentation.

👎 Cons:

  • Can still be perceived as technical by non-technical users.
  • Potential for confusion with variable naming conventions in some programming languages.
Naming design tokens: the art of clarity and consistency (8)

Words separated by underscores, all lowercase.
Example: primary_color, card_header_text, button_hover_state.

👍 Pros:

  • Clear separation between words, improving readability for all audiences.
  • Widely used in configuration files and YAML, potentially familiar to designers and developers.

👎 Cons:

  • Can appear visually cluttered and long, especially with longer names.
  • Less commonly used in design systems compared to other options.

Similar to underscore_case, but uses hyphens instead of underscores.
Example: primary-color, card-header-text, button-hover-state.

👍 Pros:

  • Offers a visual distinction from snake_case, potentially aiding readability.
  • Used in some design systems and CSS naming conventions.

👎 Cons:

  • Can be visually similar to URLs or file paths, potentially causing confusion.
  • Not as widely recognized as other case conventions.

You can create a clear and consistent naming system for your design tokens by carefully evaluating the principles and patterns outlined above. Not only will this increase the usability and maintainability of your design system, but it will also create greater communication and collaboration between design and development teams. Remember that good design token names are an investment in your design system’s long-term success and scalability.

Thanks for the clap 👏 if you liked this article! Also I tried to produce a decent reference based on my experience working on a variety of design systems, and I hope this post was useful. Please stay tuned for additional updates and let me know if you have any questions.

Naming design tokens: the art of clarity and consistency (2024)

FAQs

How do you name design tokens? ›

Design Token Naming Principles

Make use of context: Include context about the token's usage, such as the component to which it applies or its role in the design system. Keep it brief: Aim for names that are brief and memorable, as well as easy to type and read. Avoid names that are too long or too complicated.

What are design tokens in a design system? ›

They are abstract representations of visual design decisions. Rather than hardcoding specific values (like a hex code for a color) directly into components, design tokens provide a centralized way to manage and update design properties across an entire system.

How do you name design system components? ›

Components
  1. Naming structure: {prefix}-{name} .
  2. Prefix: Component names always start with a prefix and a hyphen. ...
  3. Noun rather than verb: Components are not actions, they are conceptually “things.” It is better to use nouns instead of verbs, such as <animation/> instead of <animating/> .

How to organize design tokens? ›

Design Tokens can be organized by their PROFILE and TIER. They can be of TYPE Primitive, System, and Component. Each TYPE has a specific way of being named and of referencing RAW values or other tokens. Token names should not describe the values they hold.

What are token names? ›

Name tokens are the smallest indivisible elements of a name that consist of "white space" or punctuation-delimited strings of characters. Name tokens are usually affixes or stems, though they can sometimes be full name phrases in cases where the smaller grammatical units in a name are written as a single word.

What is the difference between design tokens and styles? ›

Styles vs Tokens

Styles and tokens are both ways to store and manage design elements in Figma. However, they have different strengths and weaknesses. Styles are more flexible and can be used to store a wider variety of values. For example, you can use styles to store colors, fonts, spacing, and even animations.

What is an example of a token? ›

a memento; souvenir; keepsake: The seashell was a token of their trip. something used to indicate authenticity, authority, etc.; emblem; badge: Judicial robes are a token of office.

What is the anatomy of a design token? ›

Anatomy. Each design token has a unique name and its corresponding value. This name/value pairing is similar to a dictionary data structure found in engineering, where a key is associated with a value, and the key/value pair can be used to store and retrieve data.

How do you name your colors in a design system? ›

There are different approaches to naming colors in a design system. You can name colors using abstract names (e.g. #b9b9b9 - pigeon), actual names (e.g. #b9b9b9 - silver), numbers (e.g. #b9b9b9 - silver-1) or functional names (e.g. #b9b9b9 - silver-base).

What are the rules for naming tokens? ›

The rules
  • All global tokens should have a name that starts with Global . Example: Global.Color.Berry.Primary.
  • All alias tokens should have a name that starts with Set in the JSON file, though we typically omit that when talking about the token. ...
  • Control mappings should never have a prefix.

How do you name design concepts? ›

Best practices for naming elements in a design system
  1. Logical: Describe the component clearly, using a name that represents it. ...
  2. Scalable: Find names that allow for possible variations or additions to the component that could come in the future. ...
  3. Simple: Keep names short and basic.
Jun 16, 2022

What is the best practice for component naming? ›

Use recognisable names for each component

Naming components is an important part of creating a design, it can helps designers and developers to collaborate more effectively. By using recognisable names for each component, We can avoid confusion among designers and developers and use the Design System easily.

How do you name semantic design tokens? ›

Core tokens should be named after how they look. For instance, red-100 will represent a color token from the red color palette. Semantic tokens, which are alias of core tokens should be named after how they should be used used for. The name of a semantic token should convey the intention instead of its value.

What are the basics of design tokens? ›

Design tokens are central and tiny pieces of UI information to store design related information such as colors, fonts, spaces, animations, etc... Their benefits is that they can be transformed and formatted to meet the needs of any platform (Android, iOS, Web, etc…).

What is a token template? ›

Token templates provide the operating parameters, such as passcode or PIN strength, for a token. The templates are applied every time a token is enrolled. The operating parameters in a template vary depending on the token type. In addition, the selection of one option may affect the availability of another option.

How do developers use design tokens? ›

The designer makes a style update in a design tool. A design tokens generator automatically updates a centralized repository by generating platform-specific files (CSS, JSON or YAML). Engineers fetch the updated repository, incorporate any new tokens, and automatically update the project styles.

Who came up with design tokens? ›

The term 'design token' was first coined by Jina Anne at Salesforce in 2014. They can represent a wide range of properties and link ('alias') to other tokens, making them scalable by nature.

What is the difference between variables and design tokens? ›

Design tokens are a collection of predefined values for elements like colors, typography, and spacing. They're stored in a platform-agnostic format, but can be transformed using platform-specific tools such as Variables in Figma. Crucially, design tokens should be shared across your design and development teams.

Top Articles
Octophobia (Fear of the Number 8): Symptoms & Treatment
New U.S. Citizens | USCIS
Katie Nickolaou Leaving
Victor Spizzirri Linkedin
Obor Guide Osrs
Fort Carson Cif Phone Number
Falgout Funeral Home Obituaries Houma
St Als Elm Clinic
Toyota gebraucht kaufen in tacoma_ - AutoScout24
Is Csl Plasma Open On 4Th Of July
THE 10 BEST River Retreats for 2024/2025
Rochester Ny Missed Connections
Craigslist Chautauqua Ny
Marion County Wv Tax Maps
House Party 2023 Showtimes Near Marcus North Shore Cinema
Premier Reward Token Rs3
Moonshiner Tyler Wood Net Worth
Eka Vore Portal
Craigslist Malone New York
Northern Whooping Crane Festival highlights conservation and collaboration in Fort Smith, N.W.T. | CBC News
Les Rainwater Auto Sales
1v1.LOL - Play Free Online | Spatial
Raz-Plus Literacy Essentials for PreK-6
Free Personals Like Craigslist Nh
Foolproof Module 6 Test Answers
Delectable Birthday Dyes
Manuela Qm Only
6892697335
Sensual Massage Grand Rapids
Jackass Golf Cart Gif
Pokémon Unbound Starters
Craigslist Boerne Tx
134 Paige St. Owego Ny
Missing 2023 Showtimes Near Mjr Southgate
Dubois County Barter Page
Roto-Rooter Plumbing and Drain Service hiring General Manager in Cincinnati Metropolitan Area | LinkedIn
American Bully Xxl Black Panther
House Of Budz Michigan
Craigslist Georgia Homes For Sale By Owner
RALEY MEDICAL | Oklahoma Department of Rehabilitation Services
Hindilinks4U Bollywood Action Movies
'Guys, you're just gonna have to deal with it': Ja Rule on women dominating modern rap, the lyrics he's 'ashamed' of, Ashanti, and his long-awaited comeback
Trivago Anaheim California
Rocky Bfb Asset
Exploring the Digital Marketplace: A Guide to Craigslist Miami
فیلم گارد ساحلی زیرنویس فارسی بدون سانسور تاینی موویز
[Teen Titans] Starfire In Heat - Chapter 1 - Umbrelloid - Teen Titans
Darkglass Electronics The Exponent 500 Test
Strange World Showtimes Near Marcus La Crosse Cinema
Jeep Forum Cj
Doelpuntenteller Robert Mühren eindigt op 38: "Afsluiten in stijl toch?"
Naughty Natt Farting
Latest Posts
Article information

Author: Aracelis Kilback

Last Updated:

Views: 5931

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Aracelis Kilback

Birthday: 1994-11-22

Address: Apt. 895 30151 Green Plain, Lake Mariela, RI 98141

Phone: +5992291857476

Job: Legal Officer

Hobby: LARPing, role-playing games, Slacklining, Reading, Inline skating, Brazilian jiu-jitsu, Dance

Introduction: My name is Aracelis Kilback, I am a nice, gentle, agreeable, joyous, attractive, combative, gifted person who loves writing and wants to share my knowledge and understanding with you.