UX Collective

We believe designers are thinkers as much as they are makers. https://linktr.ee/uxc

Follow publication

Design Tokens: How to use them effectively

Ish∆n
UX Collective
Published in
6 min readMar 2, 2020
Image of casino using token which resembles name to token used in design

“It used to be that designers made an object and walked away. Today the emphasis must shift to designing the entire lifecycle.”

Paul Saffo — technology forecaster

What is Design Token?

Design Tokens are visual atoms of the design system — specifically, they are named entities that store visual design attributes.

We use then in place of hard-coded values in order to maintain a scalable and consistent visual system.

Jina @jina

Types of Design Tokens ?

Global Token:

Example of global token in the image

Alias Token:

Example of alias token in the image

Component-specific token:

Example of component specific token in the image

How Design Token Works?

Diagram showing how token can be used in designing all products and its ecosystem
Source: Design token for dummies article
Image showing Design token community group
design-token/community-group

Implementing Design Token

yarn init
yarn add style-dictionary
const axios = require("axios");async function getFigmaObjTree(figmaApiKey, figmaId) {
axios.get('https://api.figma.com/v1/files/' + figmaId, {
headers: {
"X-Figma-Token": figmaApiKey,
"Content-Type": "application/json"
}
})
.then(res => {
let result = res.data;
console.log(result);
})
.catch(err => {
console.log('errors');
console.log(err);
});
}
getFigmaObjTree('******figmaAPIKEY******', '****FigmaID****');
An interactive GIF showing design token in action
yarn build
my-gist

Conclusion

Design token process using Figma with its API
DT creation process

Recommended references

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Responses (1)

Write a response