Design tokens for dummies (2024)

As you may have noticed, design systems is a hot topic in the industry right now. According to our dear Brad Frost:

“A design system is basically the story of how an organization builds a digital product” ~ Brad Frost, Brad Frost on Let’s Work Together! at SmashingConf Barcelona 2017

Within a company, a design system improves the collaboration between product teams. A common issue design and engineering teams are facing is sharing brand guidelines and interface information. What is designed should be respected during development but we all know it’s not that simple. Product teams need guidelines to ensure brand consistency. This is where styleguides and pattern libraries come into play.

Let’s take “Nachos”: the old Trello’s design system before it was acquired by Atlassian . In most of the styleguide we encounter, including this one, we often find a section where “core styles” are defined. By “core styles” I mean indivisible pieces of an interface like colors, font-sizes, spaces, animations, shadows, z-indexes, breakpoints and so on… These central and tiny pieces of UI information will be used across several platform during the conception of a digital product. They’re called: design tokens.

ℹ️ This concept was created by Salesforce and its name comes from Jina Anne.

Design tokens allow product teams to better collaborate and ensure brand consistency across any platform 👨🏻‍🏫🎉

Design tokens for dummies (1)

As you can imagine, these colors are meant to be used across all of the Trello’s interfaces whatever the platform they live in. All of them have their own requirements and data formats:

  • On the web I could use RGB values formatted in a .css file
  • On iOS I could use RGBA values formatted as .json format
  • Android might like 8 Digit Hex (AARRGGBB) values formatted as .xml.

Also, these platforms are surely going to change and evolve over time. This is why maintaining all of them individually is a costly and time consuming process for companies.

As a front-end developer, I assume designers are responsible for taking design decisions. Updating a color, a font-size or any “core style” and seeing the result in whatever platform should be effortless for them. Unfortunately, this is not currently the case.

Let’s say a color needs to be updated. The current workflow would look like this:

1) The designer updates the color in the design tool.

2) This design update is shared to the developer.

3) The developer updates the value in the code.

4) The designer can see the result in a development environment.

This workflow suffers from several pitfalls:

  • The designer depends on the developer to see the result of a core style update. This slows down the design process and makes the designer sad 😢
  • Updating a color value in the codebase is not very time consuming when you only have to update a single style variable. However the time taken to do this change is less time for a developer to work on something valuable for the company. The developer is also sad 😢
  • Since we often track project tasks with a task manager, this change would imply another ticket to deal with 😕
  • From a general point of view, this time lost by the company also delays the go to market of its products 😪

This workflow can be optimized! 💪

Close your eyes and imagine a world where a design tokens generator would be integrated in design tools. The ideal workflow would look like this:

1) The designer would update the color in the design tool.

2) The design tool updates design tokens files according to targeted platform.

3) Developers only have to retrieve or “pull” updated files and use it in their project.

This would save a lot of time for developers and ensure consistency in design making designers and product-owners happy 😃

As I said, this is an ideal workflow I imagined. To exist, design tools and development tools should be able to communicate. Currently, the only way I know to generate design tokens is by using Theo, a design token generator made by Salesforce. What Theo does is simple: it takes as input a tech agnostic file format like JSON or YAML and outputs tech specific files for each platforms.

⏰ Update 25/01: Thanks to Mattia Astorino, I can also tell you that, out of the box, Theo can just convert colors and units. Theo can’t convert value containing functions by default. For example, if we wanted to store in a token a custom animation easing value we would have to generate for each platform a specific easing function.

According to each platform, the easing value would be specified by:

  • Web (CSS): cubic-bezier(x1,x2,y1,y2)
  • Android (Java): PathInterpolatorCompat.create(x1,x2,y1,y2)
  • iOS (Swift): init(controlPoints: x1, x2, y1, y2)

The only solution I think about is creating an object which will be used by Theo:

{
“CUSTOM_EASING”: {
“x1”: {
“value”: “0.156”
},
“x2”: {
“value”: “0”
},
“y1”: {
“value”: “0.756”
},
“y2”: {
“value”: “0.5”
}
}
}

The thing is that Theo can’t natively generate easing functions for each platform since it doesn’t know what our CUSTOM_EASING is.

If Theo could in some way be used by design tools like Sketch via a plugin or natively this workflow would be possible. Especially since Sketch data can be exported in the same input format required by Theo: JSON 🤙

To go even further, this link between our design and developments tools would allow design teams to update core styles in their design tool and see the result automatically synchronized in the design system.

In this example, the design token was a color, but it could have been something else, like a font-size, a shadow or a space.

🎁 Bonus for dev folks:

  • The 24ways’s styleguide is based on the styleguide generator Fractal. Its maintainer, Paul Robert Lloyd uses design tokens in the project’s build process. The tokens contained in JSON files are inserted inside the CSS via the postcss-map plugin.
  • EightShape built a static site generator optimized for building and documenting design systems. Via a gulp task, tokens in .jsonand .yaml are compiled into a tokens.scss file.
  • There’s also Dragoman, which is a Gulp plugin to translate core design tokens across mobile and web platforms. However the project hasn’t been updated for a year. I didn’t use it yet.

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…).

⏰ Update 18/01: Jina Anne also precised me they could also be used for branding/theming for customers, and configurable settings-based theming like “dark/night mode” or “comfortable/compact” spacing changes.

They ease collaboration between product teams and ensure brand consistency throughout any targeted platform 😃

However, as far as I know, design tokens generator such as Theo can only be used at the moment by developers since design tools can’t communicate natively with design tokens generators. Currently only Sketch could do that as it exports its data in JSON.

Design tokens for dummies (2024)

FAQs

What are the basics of design tokens? ›

Design tokens are the smallest, repeatable elements of a design system that store visual properties such as colors, typography, spacing, and shadows. They act as a bridge between design and code, providing a single source of truth that can be used across various platforms and technologies.

How to apply design tokens? ›

The ideal workflow would look like this:
  1. The designer would update the color in the design tool.
  2. The design tool updates design tokens files according to targeted platform.
  3. Developers only have to retrieve or “pull” updated files and use it in their project.

Are design tokens worth it? ›

Design tokens are vital for capturing all the design decisions utilized within your design system. These decisions cover a variety of elements that define your product and brand, such as colors, text, borders, and animations.

When not to use design tokens? ›

Tokens may be less helpful if:
  • Your existing app uses hard-coded values that will not change in the next 1-2 years.
  • Your product does not have a design system.

What are the 4 types of tokens? ›

Types of tokens
  • Access tokens.
  • ID tokens.
  • Self-signed JWTs.
  • Refresh tokens.
  • Federated tokens.
  • Bearer tokens.

What are the 5 tokens? ›

There are 5 types of tokens in python which are listed below:
  • Keywords.
  • Identifiers.
  • Literals.
  • Operators.
  • Punctuators.

Who came up with design tokens? ›

Invented by Jina Anne for the Salesforce Lightning Design System, design tokens are an approach to storing style attributes like color, typography, and spacing in a pre-determined structure.

Does Figma support design tokens? ›

Figma allows you to export design variables directly from your design files. You can export colors, text styles, and other design tokens as JSON files. To export colors, select the colors in your Figma file, then go to the “Export” option and choose JSON.

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 difference between a design token and a variable? ›

💡Design Tokens are not variables

Tokens are design decisions that are platform-agnostic and can be moved, transformed, or adapted across different platforms, unlike variables which are specific implementations of these tokens.

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 are design tokens comprised of? ›

Tokens consist of values needed to construct and maintain a design system, such as spacing, color, typography, object styles, animation, and more. They can represent anything that has a design definition, like a color as a RGB value, an opacity as a number, or an animation ease as Bezier coordinates.

What are the basics of crypto tokens? ›

In general, a crypto token is another way to say “cryptocurrency," “digital asset," or “cryptoasset." More specifically, a crypto token is an asset that represents ownership or value in a decentralized system.

Top Articles
How to create token on polygon? | Polygon Token Development
Cardless ATM Access | Helpful Tips
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Tish Haag

Last Updated:

Views: 5731

Rating: 4.7 / 5 (67 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Tish Haag

Birthday: 1999-11-18

Address: 30256 Tara Expressway, Kutchburgh, VT 92892-0078

Phone: +4215847628708

Job: Internal Consulting Engineer

Hobby: Roller skating, Roller skating, Kayaking, Flying, Graffiti, Ghost hunting, scrapbook

Introduction: My name is Tish Haag, I am a excited, delightful, curious, beautiful, agreeable, enchanting, fancy person who loves writing and wants to share my knowledge and understanding with you.