Design tokens are available for use from @email@example.com version.
Design tokens are variables that store visual design choices (colors, fonts, spaces, opacity, box-shadows, etc.). The most important thing is that tokens ensure the same style names and values are used in design files and code.
Intergalactic Design System has:
- set of base tokens that define a base palette;
- set of semantic tokens which are applied across all components and even the chart library.
These sets form the default theme of the design system.
Base tokens (palette)
Shades of the same color have a value ranging from 50 to 800, depending on its tone. Each shade has recommendations for use based on Huetone's contrast ratio calculation.
It is a list of tokens for components and charts for the default Intergalactic theme.
Semantic tokens include tokens for:
To learn more about the tokens names see Token naming structure section.
If you are creating a product that differs in style from other products of Semrush, apply a custom theme for your branding.
What is a theme?
Theme is a set of design tokens represented in CSS variables that differs from the default sets (base or semantic, or both). You can redefine them globally or only for a specific subtree of React app. Refer to Usage in development.
Creating your own theme
First of all, answer these questions for your case:
- Do you want to use the components of the Intergalactic Design System and need a completely different look and feel for them?
- Is your product not a Semrush core product?
If the answer to all the questions above is yes, then you definitely need a theme that is different from the default one.
Step one. Design new theme
Creating a theme usually starts with design. In fact, this is the most time-consuming part.
There are several ways (and, of course, there are more than the two that we offer next!). You can choose the one that suits you best based on your case.
Let's take a look at the two main theme creation situations: local and global.
Local theme: you need to try on other tokens or a new theme for a component or part of the design system
In this case we recommend you using Tokens Studio plugin for Figma. It's one of the most powerful tools for managing tokens, linking styles between the code and Figma files, and it can help you save time trying new values for tokens of your new theme.
Global theme: you need to develop a theme for the entire design system
In this case, you need to take more steps.
- Duplicate the library with tokens and three main libraries with components.
- Using the Tokens Studio plugin for Figma, you connect the tokens of the default theme with your dublicated file. How to use it to create your own set of tokens for the new theme, check the playground: internal, public.
- Test and try on the theme for all components of the library in the theme playground.
- Save the JSON of the theme, and either give it to the developers, or commit it yourself.
- Voila! You are awesome!
Step two. Connect the new theme to the components in code
This is where the magic of converting the json file with tokens into a new theme for the design system components begins.
We recommend you to check: