Color
Elevation
Surface
Focus-ring
Form
Pagination
Side-nav
Tabs
Tooltip
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.
<FlightIcon @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.