Design Tokens
A single source of truth
Design tokens are named values for the decisions in the system: colours, type, spacing, flow, the layout grid, shadows and elevation.
The tokens are defined in Figma and published in the @ldn-viz/themes package. Each semantic token is named for its purpose, such as --color-text-muted for secondary text. When a token's value changes, everything that uses the token takes the new value.
Use
The components use the tokens already. In your own markup, each token is a CSS custom property:
.summary {
color: var(--color-text-muted);
padding: var(--spacing-4);
}If your app uses Tailwind, as the component library does, the theme package's preset makes each token a utility. The utility's prefix comes first, then the token name without the --, so bg-color-surface sets the background to --color-surface. Spacing utilities use the numbered scale, so p-4 is 16px of padding.
To use a colour in JavaScript, for example to pass it to a chart library, use theme from @ldn-viz/ui. It returns the value for the current mode:
import { theme } from '@ldn-viz/ui';
const seriesColour = theme.tokenNameToValue('data.primary');Use a class for typography and flow tokens. A type role, such as title-md, is set by five tokens: font family, size, weight, line height and letter spacing. Each of those tokens has a value for each typeset and breakpoint. The class sets the text to the values for the typeset and breakpoint it's in, so use the class rather than the tokens. A flow token, such as --flow-section, takes its value from the nearest flow context class, such as flow-standard. See Typography and Flow for more detail.
<section class="flow-standard">
<h2 class="title-md">Housing completions</h2>
<p class="body-md">…</p>
</section>How it works
Primitive and semantic tokens
Tokens are in two tiers. A primitive token is named by its value or its step on a scale, such as a light mode or dark mode blue at step 700.
A semantic is an alias to a primitive token and says what a value is for, such as --color-surface-accent.
Light
#0067b4 (Raw value)--primitive-color-mode-light-blue-700 (Primitive)--color-palette-blue-700 (Semantic)--color-surface-accent (Semantic)Dark
#4c9fea (Raw value)--primitive-color-mode-dark-blue-700 (Primitive)--color-palette-blue-700 (Semantic)--color-surface-accent (Semantic)Use semantic tokens only. In the example above the semantic token --color-palette-blue-700 aliases a different primitive depending on the user preference for light or dark mode. This lets us adjust colours to be accessible in different modes. Primitive custom properties start with --primitive-, so a use of one is easy to spot.
Reading a token name
A token name is built from segments, from general to specific:
category → variant → concept → role → emphasis → state → value
A segment that doesn't apply is left out, and the rest keep their order. --color-interactive-primary-hover is the category color, the concept interactive, the role primary and the state hover.
| Segment | What it says | Examples |
|---|---|---|
| Category | The kind of value | color spacing typography flow grid shadow elevation |
| Variant | A mode, scope, breakpoint, typeset or context | inverse static chart geo md product standard |
| Concept | The thing the value is for | canvas surface interactive text border data |
| Role | Its place in a hierarchy, or what it signals | primary secondary positive negative caution title |
| Emphasis | Less contrast than the default | muted wash |
| State | An interaction, selection or availability state | hover active selected disabled |
| Value | A size, step or property | sm md lg 4 font-size |
Names are lowercase, with hyphens between words. A fractional step uses a hyphen, so --spacing-0-5 is 2px.
A default token has no -default suffix. --color-border is the default border colour, and there's no --color-border-default. A flow context and a size are always named, as in --flow-standard-loose and --shadow-md.
Typography tokens have a breakpoint and a size in the same name. In --typography-md-product-title-md-font-size, the first md is the breakpoint and the second is the size of the title. The smallest breakpoint is base, which covers widths below sm.
Concepts
An interface is a stack. The canvas is at the base, and surfaces sit above it at elevation steps 1 to 6. A surface is coloured surface, or surface-muted to set it apart from what is around it. Text, labels, borders and interactive elements sit on a surface.
Inverse
The inverse variant is for content on an inverse background. The inverse surface is dark in light mode and light in dark mode. Use inverse tokens together, such as --color-inverse-text on --color-inverse-surface.
Light
--color-text --color-surface --color-inverse-text --color-inverse-surface Dark
--color-text --color-surface --color-inverse-text --color-inverse-surface Usage aliases
We provide a set of usage aliases for users who aren't fully engaged with the system and just want to know "what's the right class for a card title". A usage alias is a class named for the place it's used, such as card-title or chart-tick. These classes are an extra layer of semantic sugar. Each one applies a type role for a specific component, as in card-title. Typography lists them.
Reference
These tables list every published semantic token, with its value.
Colour
The colour tokens are grouped by concept. Each has a value for light mode and dark mode. Colour explains how to choose one.
Palette
The palette provides the lowest level semantic tokens. Many of the other semantic tokens are aliases of values within the palette. Each color has values at 100 - 1100
Quantitative colour scales can be based on the palette colors. See Quantitative colour.
| Token | Light | Dark |
|---|---|---|
--color-palette-grey-100 | #f0f1f2 | #192023 |
--color-palette-grey-200 | #d6d8da | #2b3338 |
--color-palette-grey-300 | #bdc0c2 | #3d454b |
--color-palette-grey-400 | #a4a8ac | #52595e |
--color-palette-grey-500 | #8c9295 | #676e73 |
--color-palette-grey-600 | #757c80 | #7e8488 |
--color-palette-grey-700 | #5f666b | #959b9e |
--color-palette-grey-800 | #495157 | #adb2b4 |
--color-palette-grey-900 | #353d43 | #c5c8ca |
--color-palette-grey-1000 | #232a2e | #e0e1e2 |
--color-palette-grey-1100 | #13181c | #f9f9f9 |
--color-palette-blue-100 | #e6f2fd | #001f42 |
--color-palette-blue-200 | #b9dbfd | #003162 |
--color-palette-blue-300 | #90c5f9 | #004582 |
--color-palette-blue-400 | #65adf1 | #0059a2 |
--color-palette-blue-500 | #3c96e4 | #006fc0 |
--color-palette-blue-600 | #0e7ed1 | #2287d9 |
--color-palette-blue-700 | #0067b4 | #4c9fea |
--color-palette-blue-800 | #005194 | #75b6f5 |
--color-palette-blue-900 | #003c74 | #9dccfb |
--color-palette-blue-1000 | #002953 | #cbe4fd |
--color-palette-blue-1100 | #001835 | #f5f9fe |
--color-palette-green-100 | #e9f4eb | #002508 |
--color-palette-green-200 | #bde0c5 | #003b12 |
--color-palette-green-300 | #94cda2 | #00501d |
--color-palette-green-400 | #6ab880 | #00662a |
--color-palette-green-500 | #41a362 | #007e3c |
--color-palette-green-600 | #148d49 | #279552 |
--color-palette-green-700 | #007534 | #51ac6e |
--color-palette-green-800 | #005d24 | #7ac08d |
--color-palette-green-900 | #004617 | #a2d4ae |
--color-palette-green-1000 | #00300d | #cde7d2 |
--color-palette-green-1100 | #001d05 | #f6faf7 |
--color-palette-yellow-100 | #fff71c | #221f00 |
--color-palette-yellow-200 | #e8db00 | #363200 |
--color-palette-yellow-300 | #cfc300 | #4b4500 |
--color-palette-yellow-400 | #b6ab00 | #615a00 |
--color-palette-yellow-500 | #9d9400 | #776f00 |
--color-palette-yellow-600 | #867d00 | #8e8500 |
--color-palette-yellow-700 | #6e6700 | #a79d00 |
--color-palette-yellow-800 | #575100 | #c0b400 |
--color-palette-yellow-900 | #423d00 | #d8cc00 |
--color-palette-yellow-1000 | #2d2a00 | #f2e500 |
--color-palette-yellow-1100 | #1b1800 | #ffff77 |
--color-palette-orange-100 | #ffece4 | #410900 |
--color-palette-orange-200 | #ffcdb6 | #631400 |
--color-palette-orange-300 | #ffac88 | #831f00 |
--color-palette-orange-400 | #ff8657 | #a42d00 |
--color-palette-orange-500 | #f36428 | #c53e00 |
--color-palette-orange-600 | #d94b00 | #e4530c |
--color-palette-orange-700 | #b83700 | #fc6f38 |
--color-palette-orange-800 | #972700 | #ff956b |
--color-palette-orange-900 | #751a00 | #ffb898 |
--color-palette-orange-1000 | #530f00 | #ffd9c8 |
--color-palette-orange-1100 | #350600 | #fff7f4 |
--color-palette-red-100 | #ffede9 | #480000 |
--color-palette-red-200 | #ffccc4 | #6b0000 |
--color-palette-red-300 | #ffaa9e | #8f0000 |
--color-palette-red-400 | #ff8478 | #b50000 |
--color-palette-red-500 | #ff554d | #dc000b |
--color-palette-red-600 | #f21a24 | #fb2f31 |
--color-palette-red-700 | #cd0000 | #ff695f |
--color-palette-red-800 | #a50000 | #ff9387 |
--color-palette-red-900 | #7f0000 | #ffb6ab |
--color-palette-red-1000 | #5a0000 | #ffd8d2 |
--color-palette-red-1100 | #3a0000 | #fff7f6 |
--color-palette-pink-100 | #ffecef | #470012 |
--color-palette-pink-200 | #ffcad2 | #69001f |
--color-palette-pink-300 | #ffa7b6 | #8d002e |
--color-palette-pink-400 | #ff809a | #b2003e |
--color-palette-pink-500 | #ff4f7a | #d80053 |
--color-palette-pink-600 | #ec1f61 | #f5326a |
--color-palette-pink-700 | #c9004a | #ff6588 |
--color-palette-pink-800 | #a20037 | #ff90a6 |
--color-palette-pink-900 | #7d0027 | #ffb4c1 |
--color-palette-pink-1000 | #590019 | #ffd7dd |
--color-palette-pink-1100 | #39000d | #fff7f8 |
--color-palette-darkpink-100 | #fbeef2 | #44001f |
--color-palette-darkpink-200 | #f5cdda | #660033 |
--color-palette-darkpink-300 | #eeaec4 | #890049 |
--color-palette-darkpink-400 | #e48fae | #a81761 |
--color-palette-darkpink-500 | #d77099 | #bd3c76 |
--color-palette-darkpink-600 | #c85183 | #ce5c8b |
--color-palette-darkpink-700 | #b52f6e | #dd7ca1 |
--color-palette-darkpink-800 | #9e0159 | #e89bb7 |
--color-palette-darkpink-900 | #7a0040 | #f1b9cc |
--color-palette-darkpink-1000 | #57002a | #f8d9e3 |
--color-palette-darkpink-1100 | #380018 | #fdf7f9 |
--color-palette-purple-100 | #faedfd | #360840 |
--color-palette-purple-200 | #f1cbfa | #521260 |
--color-palette-purple-300 | #e7aaf5 | #6e1e80 |
--color-palette-purple-400 | #d98aec | #8a2d9e |
--color-palette-purple-500 | #c96bde | #a440bb |
--color-palette-purple-600 | #b450cb | #bc5ad3 |
--color-palette-purple-700 | #9a39b0 | #d077e5 |
--color-palette-purple-800 | #7e2792 | #df96f0 |
--color-palette-purple-900 | #621972 | #eab5f7 |
--color-palette-purple-1000 | #460d53 | #f4d8fb |
--color-palette-purple-1100 | #2c0535 | #fcf7fe |
--color-palette-turquoise-100 | #d6f8f1 | #07241f |
--color-palette-turquoise-200 | #96e6d7 | #0f3832 |
--color-palette-turquoise-300 | #70d0c0 | #184c44 |
--color-palette-turquoise-400 | #57b8a8 | #226258 |
--color-palette-turquoise-500 | #459f91 | #2e796d |
--color-palette-turquoise-600 | #36887b | #3b9083 |
--color-palette-turquoise-700 | #297065 | #4ca99b |
--color-palette-turquoise-800 | #1e5951 | #5fc1b2 |
--color-palette-turquoise-900 | #14433c | #7cd8c9 |
--color-palette-turquoise-1000 | #0b2e29 | #abeee1 |
--color-palette-turquoise-1100 | #051b18 | #f1fbf9 |
Canvas
| Token | Light | Dark |
|---|---|---|
--color-canvas | #ffffff | #0e1316 |
--color-canvas-muted | #f7f8f9 | #151b1e |
Surface
| Token | Light | Dark |
|---|---|---|
--color-surface | #ffffff | #0e1316 |
--color-surface-accent | #0067b4 | #4c9fea |
--color-surface-accent-muted | #e6f2fd | #003162 |
--color-surface-negative-muted | #ffede9 | #6b0000 |
--color-surface-positive-muted | #e9f4eb | #003b12 |
--color-surface-caution-muted | #ffece4 | #631400 |
--color-surface-neutral-muted | #f0f1f2 | #192023 |
--color-surface-empty-muted | #f0f1f2 | #192023 |
--color-surface-muted | #f0f1f2 | #192023 |
--color-surface-alpha-muted | #ffecef | #69001f |
--color-surface-beta-muted | #e6f2fd | #003162 |
--color-surface-alpha | #c9004a | #d80053 |
--color-surface-beta | #007acc | #007acc |
--color-surface-neutral | #d6d8da | #2b3338 |
--color-surface-negative | #cd0000 | #ff695f |
--color-surface-positive | #007534 | #51ac6e |
--color-surface-caution | #b83700 | #fc6f38 |
--color-surface-empty | #bdc0c2 | #3d454b |
Text
| Token | Light | Dark |
|---|---|---|
--color-text | #353d43 | #ffffff |
--color-text-muted | #5f666b | #c5c8ca |
--color-text-wash | #5f666b | #c5c8ca |
Label
| Token | Light | Dark |
|---|---|---|
--color-label | #353d43 | #ffffff |
--color-label-muted | #5f666b | #c5c8ca |
Border
| Token | Light | Dark |
|---|---|---|
--color-border | #5f666b | #c5c8ca |
--color-border-muted | #8c9295 | #676e73 |
--color-border-wash | #d6d8da | #52595e |
Interactive
| Token | Light | Dark |
|---|---|---|
--color-interactive-selected | #0067b4 | #006fc0 |
--color-interactive-on | #0067b4 | #006fc0 |
--color-interactive-off | #8c9295 | #676e73 |
--color-interactive-dragged | #3c96e4 | #006fc0 |
--color-interactive-primary | #0067b4 | #006fc0 |
--color-interactive-primary-active | #003c74 | #004582 |
--color-interactive-primary-muted | #e6f2fd | #001f42 |
--color-interactive-primary-muted-hover | #b9dbfd | #003162 |
--color-interactive-primary-muted-active | #90c5f9 | #004582 |
--color-interactive-primary-hover | #005194 | #0059a2 |
--color-interactive-primary-text | #0067b4 | #4c9fea |
--color-interactive-primary-text-hover | #005194 | #75b6f5 |
--color-interactive-primary-text-active | #003c74 | #9dccfb |
--color-interactive-secondary | #5f666b | #adb2b4 |
--color-interactive-secondary-hover | #495157 | #c5c8ca |
--color-interactive-secondary-active | #353d43 | #e0e1e2 |
--color-interactive-secondary-muted | #d6d8da | #2b3338 |
--color-interactive-secondary-muted-hover | #bdc0c2 | #3d454b |
--color-interactive-secondary-muted-active | #a4a8ac | #52595e |
--color-interactive-negative | #cd0000 | #ff695f |
--color-interactive-negative-hover | #a50000 | #ff9387 |
--color-interactive-negative-active | #7f0000 | #ffb6ab |
--color-interactive-negative-muted | #ffede9 | #6b0000 |
--color-interactive-negative-muted-hover | #ffccc4 | #8f0000 |
--color-interactive-negative-muted-active | #ffaa9e | #b50000 |
--color-interactive-positive | #007534 | #51ac6e |
--color-interactive-positive-hover | #005d24 | #7ac08d |
--color-interactive-positive-active | #004617 | #a2d4ae |
--color-interactive-positive-muted | #e9f4eb | #003b12 |
--color-interactive-positive-muted-hover | #bde0c5 | #003b12 |
--color-interactive-positive-muted-active | #94cda2 | #00501d |
--color-interactive-caution | #b83700 | #fc6f38 |
--color-interactive-caution-hover | #972700 | #ff956b |
--color-interactive-caution-active | #751a00 | #ffb898 |
--color-interactive-caution-muted-hover | #ffcdb6 | #831f00 |
--color-interactive-caution-muted-active | #ffac88 | #a42d00 |
--color-interactive-caution-muted | #ffece4 | #631400 |
--color-interactive-disabled | #8c9295 | #959b9e |
--color-interactive-disabled-muted | #d6d8da | #3d454b |
--color-interactive-focus | #0067b4 | #006fc0 |
--color-interactive-error | #cd0000 | #ff695f |
Inverse
| Token | Light | Dark |
|---|---|---|
--color-inverse-canvas | #0e1316 | #ffffff |
--color-inverse-canvas-muted | #151b1e | #f7f8f9 |
--color-inverse-text | #ffffff | #2b3338 |
--color-inverse-text-muted | #bdc0c2 | #676e73 |
--color-inverse-text-wash | #bdc0c2 | #676e73 |
--color-inverse-surface | #13181c | #f9f9f9 |
--color-inverse-surface-muted | #353d43 | #e0e1e2 |
--color-inverse-chart-label | #ffffff | #2b3338 |
--color-inverse-chart-label-muted | #bdc0c2 | #676e73 |
--color-inverse-chart-axis | #ffffff | #2b3338 |
--color-inverse-chart-grid | #232a2e | #e0e1e2 |
--color-inverse-chart-surface | #0e1316 | #ffffff |
--color-inverse-geo-feature | #ffffff | #2b3338 |
--color-inverse-geo-feature-muted | #8c9295 | #676e73 |
--color-inverse-geo-interactive | #0067b4 | #4c9fea |
--color-inverse-geo-interactive-hover | #005194 | #75b6f5 |
--color-inverse-geo-interactive-selected | #fff200 | #fff200 |
--color-inverse-geo-interactive-focus | #0067b4 | #4c9fea |
--color-inverse-geo-interactive-disabled | #8c9295 | #959b9e |
--color-inverse-geo-interactive-error | #cd0000 | #ff695f |
--color-inverse-geo-label | #ffffff | #2b3338 |
--color-inverse-geo-label-muted | #bdc0c2 | #676e73 |
--color-inverse-geo-annotation | #ffffff | #2b3338 |
--color-inverse-geo-annotation-muted | #bdc0c2 | #676e73 |
--color-inverse-border | #ffffff | #2b3338 |
--color-inverse-border-muted | #8c9295 | #676e73 |
--color-inverse-border-wash | #52595e | #d6d8da |
Static
| Token | Light | Dark |
|---|---|---|
--color-static-brand | #007acc | #007acc |
--color-static-white | #ffffff | #ffffff |
--color-static-black | #000000 | #000000 |
--color-static-gla-darkblue | #00577d | #00577d |
--color-static-gla-blue | #007acc | #007acc |
--color-static-gla-cyan | #00aeef | #00aeef |
--color-static-gla-green | #008743 | #008743 |
--color-static-gla-yellow | #fff200 | #fff200 |
--color-static-gla-mustard | #dca000 | #dca000 |
--color-static-gla-orange | #e85713 | #e85713 |
--color-static-gla-red | #eb001b | #eb001b |
--color-static-gla-pink | #e7135d | #e7135d |
--color-static-gla-darkpink | #9e0059 | #9e0059 |
--color-static-gla-purple | #ae4ac6 | #ae4ac6 |
--color-static-gla-grey | #353d42 | #353d42 |
Data
| Token | Light | Dark |
|---|---|---|
--color-data-categorical-blue | #007acc | #00aeef |
--color-data-categorical-darkpink | #9e0059 | #9e0059 |
--color-data-categorical-pink | #e7135d | #da4476 |
--color-data-categorical-red | #eb001b | #eb001b |
--color-data-categorical-yellow | #fff200 | #fff200 |
--color-data-categorical-green | #41a362 | #41a362 |
--color-data-categorical-purple | #460d53 | #ae4ac6 |
--color-data-categorical-orange | #f36428 | #f36428 |
--color-data-categorical-turquoise | #57b8a8 | #7cd8c9 |
--color-data-primary | #007acc | #00aeef |
--color-data-secondary | #9e0059 | #da4476 |
--color-data-tertiary | #f36428 | #f36428 |
--color-data-neutral-0 | #bdc0c2 | #3d454b |
--color-data-neutral-1 | #a4a8ac | #52595e |
--color-data-positive | #007acc | #00aeef |
--color-data-negative | #eb001b | #eb001b |
--color-data-empty | #d6d8da | #2b3338 |
--color-data-context | #bdc0c2 | #3d454b |
--color-data-male | #41a362 | #41a362 |
--color-data-female | #460d53 | #ae4ac6 |
Chart
| Token | Light | Dark |
|---|---|---|
--color-chart-axis | #353d43 | #ffffff |
--color-chart-grid | #d6d8da | #2b3338 |
--color-chart-surface | #ffffff | #0e1316 |
--color-chart-label | #353d43 | #ffffff |
--color-chart-label-muted | #5f666b | #c5c8ca |
Geo
| Token | Light | Dark |
|---|---|---|
--color-geo-feature | #5f666b | #c5c8ca |
--color-geo-feature-muted | #8c9295 | #676e73 |
--color-geo-interactive | #0067b4 | #4c9fea |
--color-geo-interactive-hover | #005194 | #75b6f5 |
--color-geo-interactive-selected | #fff200 | #fff200 |
--color-geo-interactive-focus | #0067b4 | #4c9fea |
--color-geo-interactive-disabled | #8c9295 | #959b9e |
--color-geo-interactive-error | #cd0000 | #ff695f |
--color-geo-label | #353d43 | #ffffff |
--color-geo-label-muted | #5f666b | #c5c8ca |
--color-geo-annotation | #353d43 | #ffffff |
--color-geo-annotation-muted | #5f666b | #c5c8ca |
Typography
Choose a typeset and a breakpoint to see the values for each role. Typography explains the roles and typesets.
Each value is the token --typography-base-product-{role}-{property}.
| Role | font-size | line-height | font-weight | letter-spacing |
|---|---|---|---|---|
| display-lg | 40px | 48px | 700 | 0px |
| display-md | 36px | 44px | 700 | 0px |
| display-sm | 32px | 40px | 700 | 0px |
| headline-lg | 30px | 38px | 700 | 0px |
| headline-md | 28px | 36px | 700 | 0px |
| headline-sm | 26px | 34px | 700 | 0px |
| subhead-lg | 24px | 32px | 400 | 0px |
| subhead-md | 22px | 30px | 400 | 0px |
| subhead-sm | 20px | 28px | 400 | 0px |
| title-lg | 22px | 30px | 600 | 0px |
| title-md | 20px | 28px | 600 | 0px |
| title-sm | 18px | 26px | 600 | 0px |
| subtitle-lg | 20px | 28px | 400 | 0px |
| subtitle-md | 18px | 26px | 400 | 0px |
| subtitle-sm | 16px | 24px | 400 | 0px |
| body-lg | 18px | 26px | 400 | 0px |
| body-md | 16px | 24px | 400 | 0px |
| body-sm | 14px | 22px | 400 | 0px |
| label-lg | 18px | 26px | 500 | 0px |
| label-md | 14px | 22px | 500 | 0px |
| label-sm | 12px | 20px | 500 | 0px |
| metric-lg | 28px | 32px | 700 | 0px |
| metric-md | 24px | 28px | 700 | 0px |
| metric-sm | 20px | 24px | 700 | 0px |
| eyebrow | 14px | 18px | 500 | 0px |
| caption-sm | 12px | 16px | 400 | 0px |
| caption-md | 14px | 18px | 400 | 0px |
| caption-lg | 16px | 20px | 400 | 0px |
Spacing
Spacing explains the scale.
| Token | Value | Pixels |
|---|---|---|
--spacing-px | 0.0625rem | 1px |
--spacing-0-5 | 0.125rem | 2px |
--spacing-1 | 0.25rem | 4px |
--spacing-1-5 | 0.375rem | 6px |
--spacing-2 | 0.5rem | 8px |
--spacing-2-5 | 0.625rem | 10px |
--spacing-3 | 0.75rem | 12px |
--spacing-3-5 | 0.875rem | 14px |
--spacing-4 | 1rem | 16px |
--spacing-5 | 1.25rem | 20px |
--spacing-6 | 1.5rem | 24px |
--spacing-7 | 1.75rem | 28px |
--spacing-8 | 2rem | 32px |
--spacing-10 | 2.5rem | 40px |
--spacing-12 | 3rem | 48px |
--spacing-14 | 3.5rem | 56px |
--spacing-16 | 4rem | 64px |
--spacing-20 | 5rem | 80px |
--spacing-24 | 6rem | 96px |
Flow
Flow explains the contexts and steps.
| Token | Value | Pixels |
|---|---|---|
--flow-spacious-tight | 0.25rem | 4px |
--flow-spacious | 1rem | 16px |
--flow-spacious-loose | 1.5rem | 24px |
--flow-spacious-section | 2.5rem | 40px |
--flow-standard-tight | 0.25rem | 4px |
--flow-standard | 0.5rem | 8px |
--flow-standard-loose | 1rem | 16px |
--flow-standard-section | 1.5rem | 24px |
--flow-compact-tight | 0.25rem | 4px |
--flow-compact | 0.25rem | 4px |
--flow-compact-loose | 0.5rem | 8px |
--flow-compact-section | 0.5rem | 8px |
Layout grid
These tokens set the padding at the edge of a container, for each breakpoint and layout. Layout grid explains the layouts.
| Token | Value | Pixels |
|---|---|---|
--grid-base-contained-container-padding | 1rem | 16px |
--grid-base-fluid-container-padding | 1rem | 16px |
--grid-sm-contained-container-padding | 2rem | 32px |
--grid-sm-fluid-container-padding | 1rem | 16px |
--grid-md-contained-container-padding | 2rem | 32px |
--grid-md-fluid-container-padding | 1.5rem | 24px |
--grid-lg-contained-container-padding | 4rem | 64px |
--grid-lg-fluid-container-padding | 1.5rem | 24px |
--grid-xl-contained-container-padding | 5rem | 80px |
--grid-xl-fluid-container-padding | 1.5rem | 24px |
--grid-2xl-contained-container-padding | 6rem | 96px |
--grid-2xl-fluid-container-padding | 1.5rem | 24px |
Elevation
Elevation explains the levels.
| Token | Value | Example |
|---|---|---|
--elevation-0 | 0px 0px 0px 0px #00000000 | |
--elevation-1 | 0px 1px 2px 0px #0000000d | |
--elevation-2 | 0px 1px 3px 0px #0000001a, 0px 1px 2px -1px #0000001a | |
--elevation-3 | 0px 2px 4px -2px #0000001a, 0px 4px 6px -1px #0000001a | |
--elevation-4 | 0px 4px 6px -4px #0000001a, 0px 10px 15px -3px #0000001a | |
--elevation-5 | 0px 8px 10px -6px #0000001a, 0px 20px 25px -5px #0000001a | |
--elevation-6 | 0px 25px 50px -12px #00000040 |
Shadow
To set a level of elevation, use an elevation token. --shadow-inner has no elevation step.
| Token | Value | Example |
|---|---|---|
--shadow | 0px 1px 3px 0px #0000001a, 0px 1px 2px -1px #0000001a | |
--shadow-inner | inset 0px 2px 4px 0px #0000000d | |
--shadow-sm | 0px 1px 2px 0px #0000000d | |
--shadow-md | 0px 2px 4px -2px #0000001a, 0px 4px 6px -1px #0000001a | |
--shadow-lg | 0px 4px 6px -4px #0000001a, 0px 10px 15px -3px #0000001a | |
--shadow-xl | 0px 8px 10px -6px #0000001a, 0px 20px 25px -5px #0000001a | |
--shadow-2xl | 0px 25px 50px -12px #00000040 |
Breakpoints
Breakpoints are used in media queries and as Tailwind prefixes, such as md:. A custom property can't be used in a media query, so breakpoints have no semantic tokens. Write the width in the media query.
| Breakpoint | Minimum width |
|---|---|
base | None |
sm | 640px |
md | 768px |
lg | 1024px |
xl | 1280px |
2xl | 1536px |
The full rules for tokens are in the specification.