Color
Elevation
Surface
Focus-ring
Form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
7px
-
5px
-
1px
-
-
-
-
-
-
14px
-
16px
-
3px
-
1px
-
12px
-
-
-
-
-
16px
-
1px
-
12px
-
-
-
16px
-
1px
-
6px
-
24px
-
8px
-
-
16px
-
7px
-
9px
-
-
-
16px
-
7px
-
-
-
-
-
-
32px
-
16px
-
-
3px
-
1px
-
12px
-
2px
-
-
-
-
-
16px
App-header
-
60px
-
36px
-
28px
App-side-nav
-
1px
-
-
16px
-
16px
-
8px
-
22px
-
5px
-
4px
-
48px
-
32px
-
8px
-
24px
-
36px
-
8px
-
4px
-
2px
-
8px
-
5px
-
-
-
-
-
-
Pagination
-
36px
-
12px
-
4px
-
6px
-
2px
-
6px
-
8px
-
20px
Side-nav
-
1px
-
-
16px
-
16px
-
8px
-
22px
-
5px
-
4px
-
48px
-
32px
-
8px
-
24px
-
36px
-
8px
-
4px
-
2px
-
8px
-
5px
-
-
-
-
-
-
Tabs
-
36px
-
48px
-
12px
-
20px
-
0px
-
5px
-
6px
-
6px
-
3px
-
-
-
1px
Tooltip
-
5px
-
-
-
-2px
-
280px
-
12px
-
8px
-
Typography
-
Aa
-
Aa
-
Aa
-
Aa
-
Aa
-
Aa
-
Aa
-
Aa
-
Aa
-
-
Aa
-
Aa
-
-
Aa
-
Aa
-
-
-
Aa
-
Aa
-
-
-
Aa
-
Aa
-
-
Aa
-
Aa
-
-
Aa
-
Aa
-
-
Aa
-
Aa
-
-
Aa
-
Aa
-
-
Aa
-
Aa
-
-
Aa
-
Aa
-
How to use tokens
Use tokens in styles
Use the design tokens in your style declarations as CSS custom properties.
.your-selector {
color: var(--token-color-foreground-highlight);
background: var(--token-color-background-highlight);
border: 1px solid var(--token-color-border-highlight);
font-family: var(--token-typography-body-base-font-family);
font-size: var(--token-typography-body-base-font-size);
line-height: var(--token-typography-body-base-line-height);
}
Use tokens in components
- Ensure you’ve imported the relevant CSS file.
// for product applications
@import "~@hashicorp/design-system-tokens/dist/products/css/tokens.css";
// for hashicorp developer platform
@import "~@hashicorp/design-system-tokens/dist/devdot/css/tokens.css";
- If a component accepts a color parameter you can use a design token too.
<Hds::Icon @name="alert-circle" @color="var(--token-color-foreground-success)" />
For more details on how the design tokens pipeline is implemented, and how the design tokens are generated and distributed, see the repository @hashicorp/design-system-tokens.