Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ tabs: Tokens('design-tokens'), Usage in design('design-tokens-usage'), Usage in

## Global theme

Design tokens are ideal for global theming because they help ensure consistent visual choices and behavior across the design system. They also make it easier to update and maintain the product, as changes can be made in a centralized way.
Design tokens help ensure consistent visual choices and behavior across the design system. They also make it easier to update and maintain the product, as changes can be made in a centralized way.

**Why design tokens should be used only for global theming:**
<!-- **Why design tokens should be used only for global theming:**

- By using design tokens only for global theming, you can ensure that the design system remains flexible and adaptable to a change. As the design system evolves, updates can be made to the design tokens, which will then be reflected in all relevant places throughout the design system.
- Design tokens add a centralized approach to updating the design system, making it easier to ensure that all updates are made in a controlled and deliberate manner.

To sum up, using design tokens only for global theming is a best practice because it promotes consistency, maintainability, modularity, and adaptability in the design system.
- By using design tokens for global theming, you can ensure that the design system remains flexible and adaptable to a change. As the design system evolves, updates can be made to the design tokens, which will then be reflected in all relevant places throughout the design system.
- Design tokens add a centralized approach to updating the design system look and feel, making it easier to ensure that all updates are made in a controlled and deliberate manner. -->

::: tip
If you can't find the token you are looking for, then please double-check the existing ones. If it is really missing, you can drop us a line with a request to add a new token.
If you can't find the token you are looking for, we recommend you to double-check the existing ones. If it's really missing, you can drop us a line with a request to add a new entity.
:::

### How to apply theme globally
Expand Down
4 changes: 2 additions & 2 deletions website/docs/style/design-tokens/design-tokens-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ For the Semrush developers and designers we have a couple of onboarding files. R

- [Themization workshop file](https://www.figma.com/design/7dJaaWaqoTKdeGU4Pq02rz/Themization-workshop?node-id=0-1&node-type=canvas&t=cC709O9aHUP7lTRL-11) which you can duplicate and play with the examples
- [Brief tokens explanation](https://www.figma.com/design/1TV7YbEL3FaV0znCkQtsrC/Themes'-playground-%26-tutorial-%F0%9F%8E%93?node-id=14802-111796&node-type=frame&t=qOTf0DSn0M8p63of-11) from our Theme's playground file
- [Big presentation on design tokens](https://www.figma.com/design/DfhEsCc7j9c1XTpi7mwHwt/Design-tokens-(for-designers)?node-id=0-1&node-type=canvas&t=2zFBWvB8qwRtpivO-11)
- [Presentation on design tokens](https://www.figma.com/design/DfhEsCc7j9c1XTpi7mwHwt/Design-tokens-(for-designers)?node-id=0-1&node-type=canvas&t=2zFBWvB8qwRtpivO-11)
:::

## Token sets

There are base and semantic token sets in our design system.

**Base tokens** represent the theme's global palette. Changing their values will affect semantic tokens. Therefore, by changing the palette, you can create new themes. For creating new palette you can use tools like [Huetone](https://huetone.ardov.me/).
**Base tokens** represent the theme's global palette. Changing their values will affect semantic tokens. Therefore, by changing the palette, you can create new themes. For creating new palette and meet accessibility guidelines, use tools like [Huetone](https://huetone.ardov.me/).

![](static/base-tokens.png)

Expand Down
26 changes: 14 additions & 12 deletions website/docs/style/design-tokens/design-tokens.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

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.
- **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.

Expand All @@ -25,7 +25,7 @@

## Stylelint plugin

The stylelint plugin help developers avoid mistakes in design token names. It's part of [intergalactic npm package](https://www.npmjs.com/package/intergalactic) but also might be installed as [a separate package](https://www.npmjs.com/package/@semcore/stylelint-plugin).
The stylelint plugin helps developers to avoid mistakes in the design token names. It's part of [intergalactic npm package](https://www.npmjs.com/package/intergalactic) but also might be installed as [a separate package](https://www.npmjs.com/package/@semcore/stylelint-plugin).

```json
// .stylelintrc.json
Expand All @@ -47,7 +47,7 @@

## Base tokens (palette)

The list of base tokens is our palette. It was built with [Huetone tool](https://huetone.ardov.me/) (learn more about the tool in the [Twitter thread](https://twitter.com/ardovalexey/status/1447329411678806023)).
The list of base tokens represents our palette. It was built with [Huetone tool](https://huetone.ardov.me/) (learn more about the tool in the [Twitter thread](https://twitter.com/ardovalexey/status/1447329411678806023)).

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](https://huetone.ardov.me/).

Expand All @@ -67,7 +67,7 @@

## Semantic tokens

It is a list of tokens for components and charts for the default Intergalactic theme.
It's a list of tokens for components and charts for the default Intergalactic theme.

Semantic tokens include tokens for:

Expand All @@ -78,7 +78,7 @@
- box-shadows;
- border-radius.

To learn more about the tokens names see [Token naming structure section](/style/design-tokens/design-tokens-usage#token-naming-structure).
To learn more about the tokens names, see [Token naming structure section](/style/design-tokens/design-tokens-usage#token-naming-structure).

Check warning on line 81 in website/docs/style/design-tokens/design-tokens.md

View workflow job for this annotation

GitHub Actions / docs-lint

[vale] reported by reviewdog 🐶 [DevDocs.Inclusive] For inclusivity, consider using 'refer to' instead of 'see'. Raw Output: {"message": "[DevDocs.Inclusive] For inclusivity, consider using 'refer to' instead of 'see'.", "location": {"path": "website/docs/style/design-tokens/design-tokens.md", "range": {"start": {"line": 81, "column": 39}}}, "severity": "INFO"}

::: react-view

Expand All @@ -96,22 +96,24 @@

## Themes

If you need to build a product that differs in style from our default theme, you can create a custom theme for it.
If you need to build a product that differs in style and tone of voice from our default theme, you can create a custom theme.

Theme is a set of tokens represented in CSS variables that has different from the default sets values. Values can be changed for base, semantic, or both sets. You can redefine them globally or only for a specific subtree of React app. Refer to [Usage in development](/style/design-tokens/design-tokens-usage-development).
Theme is a set of tokens represented in CSS variables that has different from the default sets values. Values can be changed for base, semantic, or both sets. You can redefine them globally or only for a specific subtree of React app. Refer to the [Usage in development](/style/design-tokens/design-tokens-usage-development).

## Creating new theme

### Step one. Design new theme

Creating a theme usually starts with design. In fact, this is the most time-consuming part.

**We recommend you using the native Figma variables (tokens) functionality**. But if you need more functionality that Figma doesn't have at the moment, use [Tokens Studio plugin for Figma](https://www.figma.com/community/plugin/843461159747178978). It's one of the most powerful tools for managing tokens, linking styles between the code and Figma files.
**We recommend you using the native Figma variables (tokens) functionality**. Refer to the following tutorials, for the detailed process for creating a new theme. Semrush designers and developers can use the following tutorials:

Refer to the following tutorials, for the detailed process for creating a new theme:
- [Tutorial for Figma tokens](https://www.figma.com/design/1TV7YbEL3FaV0znCkQtsrC/Themes'-playground-%26-tutorial-%F0%9F%8E%93?node-id=13125-73031&node-type=canvas&t=qOTf0DSn0M8p63of-11)
- [Tutorial for Tokens Studio](https://www.figma.com/design/K1s6wF8NTH3uNHvjkn6hjc/Themes'-playground-%26-tutorial-%F0%9F%8E%93?m=auto&t=jHrLhhOMB32IMklB-6)

- Semrush designers and developers can use two tutorials, [tutorial for Figma tokens](https://www.figma.com/design/1TV7YbEL3FaV0znCkQtsrC/Themes'-playground-%26-tutorial-%F0%9F%8E%93?node-id=13125-73031&node-type=canvas&t=qOTf0DSn0M8p63of-11) and [tutorial for Tokens Studio](https://www.figma.com/design/K1s6wF8NTH3uNHvjkn6hjc/Themes'-playground-%26-tutorial-%F0%9F%8E%93?m=auto&t=jHrLhhOMB32IMklB-6)
- Other users can use the [tutorial for Tokens Studio](https://www.figma.com/community/file/1274028958101796491/semrush-design-tokens)
In case if you need more functionality that Figma doesn't have at the moment, use [Tokens Studio plugin for Figma](https://www.figma.com/community/plugin/843461159747178978). It's one of the most powerful tools for managing tokens, linking styles between the code and Figma files.

For non-Semrush employees we have a [tutorial for Tokens Studio](https://www.figma.com/community/file/1274028958101796491/semrush-design-tokens).

Check warning on line 116 in website/docs/style/design-tokens/design-tokens.md

View workflow job for this annotation

GitHub Actions / docs-lint

[vale] reported by reviewdog 🐶 [DevDocs.Contractions] It's okay to use the contracted form 'we've' instead of 'we have'. Raw Output: {"message": "[DevDocs.Contractions] It's okay to use the contracted form 'we've' instead of 'we have'.", "location": {"path": "website/docs/style/design-tokens/design-tokens.md", "range": {"start": {"line": 116, "column": 27}}}, "severity": "INFO"}

::: tip
**In cases where different styles are needed for just one component or a part of the design system:**
Expand Down
Binary file modified website/docs/style/design-tokens/static/base-tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/design-tokens/static/semantic-tokens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/design-tokens/static/token-description.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/design-tokens/static/token-naming.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/design-tokens/static/token-usage1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/design-tokens/static/token-usage2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/design-tokens/static/token-usage3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/design-tokens/static/token-usage4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/end-points-gaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/icon-tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/inner-elements.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/name-color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/outline-flattern.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/perspective.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/pixel-perfection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/shapes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/sizing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/strikethrough.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/stroke-alignment-corners.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/variations.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/icon/static/viewbox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/illustration/static/large-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/illustration/static/medium-size2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified website/docs/style/illustration/static/small-size.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Binary file modified website/docs/style/typography/static/h1-p.png
Binary file modified website/docs/style/typography/static/h2-p.png
Binary file modified website/docs/style/typography/static/h3-p.png
Binary file modified website/docs/style/typography/static/h4-p.png
Binary file modified website/docs/style/typography/static/h5-p.png
Binary file modified website/docs/style/typography/static/h6-p.png
Binary file modified website/docs/style/typography/static/list-margins.png
Binary file removed website/docs/style/typography/static/metric-200.png
Diff not rendered.
Binary file removed website/docs/style/typography/static/metric-300.png
Diff not rendered.
Binary file removed website/docs/style/typography/static/metric-400.png
Diff not rendered.
Binary file removed website/docs/style/typography/static/metric-500.png
Diff not rendered.
Binary file removed website/docs/style/typography/static/metric-600.png
Diff not rendered.
Diff not rendered.
Binary file modified website/docs/style/typography/static/second-level.png
Loading