# Tokens

The design tokens are the single source of the system’s values. They ship three ways: as `--ds-*` custom properties in `tokens.css` (and `styles.css`), as typed data from `@blocks/design-system/tokens`, and as the prop types of the components (`padding="md"`). The tables below are rendered from the package’s own token data.

```ts
import { cssVarName, tokens } from '@blocks/design-system/tokens'

tokens.space.md // 8
cssVarName('space', 'md') // '--ds-space-md'
```

## Semantic colors

Components read only the semantic tier. Each name points at a Radix Colors step in each theme; dark mode and `data-ds-theme` swap these and nothing else. Steps follow Radix’s roles: 1–2 backgrounds, 3–5 component fills, 6–8 borders and focus, 9–10 solid fills, 11–12 text.

**Semantic colors**

| Token | Light | Dark |
| --- | --- | --- |
| `--ds-color-bg` | `slate-1` | `slate-dark-1` |
| `--ds-color-bg-subtle` | `slate-2` | `slate-dark-2` |
| `--ds-color-surface` | `slate-3` | `slate-dark-3` |
| `--ds-color-surface-hover` | `slate-4` | `slate-dark-4` |
| `--ds-color-surface-active` | `slate-5` | `slate-dark-5` |
| `--ds-color-selected` | `indigo-4` | `indigo-dark-4` |
| `--ds-color-border-subtle` | `slate-6` | `slate-dark-6` |
| `--ds-color-border` | `slate-7` | `slate-dark-7` |
| `--ds-color-border-strong` | `slate-8` | `slate-dark-8` |
| `--ds-color-focus-ring` | `indigo-9` | `indigo-dark-9` |
| `--ds-color-accent` | `indigo-9` | `indigo-dark-9` |
| `--ds-color-accent-hover` | `indigo-10` | `indigo-dark-10` |
| `--ds-color-accent-fg` | `#fff` | `#fff` |
| `--ds-color-accent-subtle` | `indigo-3` | `indigo-dark-3` |
| `--ds-color-accent-text` | `indigo-11` | `indigo-dark-11` |
| `--ds-color-danger` | `red-9` | `red-dark-9` |
| `--ds-color-danger-hover` | `red-10` | `red-dark-10` |
| `--ds-color-danger-fg` | `#fff` | `#fff` |
| `--ds-color-danger-subtle` | `red-3` | `red-dark-3` |
| `--ds-color-danger-text` | `red-11` | `red-dark-11` |
| `--ds-color-warning` | `amber-9` | `amber-dark-9` |
| `--ds-color-warning-hover` | `amber-10` | `amber-dark-10` |
| `--ds-color-warning-fg` | `slate-12` | `slate-12` |
| `--ds-color-warning-subtle` | `amber-3` | `amber-dark-3` |
| `--ds-color-warning-text` | `amber-11` | `amber-dark-11` |
| `--ds-color-success` | `green-9` | `green-dark-9` |
| `--ds-color-success-hover` | `green-10` | `green-dark-10` |
| `--ds-color-success-fg` | `#fff` | `#fff` |
| `--ds-color-success-subtle` | `green-3` | `green-dark-3` |
| `--ds-color-success-text` | `green-11` | `green-dark-11` |
| `--ds-color-info` | `blue-9` | `blue-dark-9` |
| `--ds-color-info-hover` | `blue-10` | `blue-dark-10` |
| `--ds-color-info-fg` | `#fff` | `#fff` |
| `--ds-color-info-subtle` | `blue-3` | `blue-dark-3` |
| `--ds-color-info-text` | `blue-11` | `blue-dark-11` |
| `--ds-color-text-muted` | `slate-11` | `slate-dark-11` |
| `--ds-color-text` | `slate-12` | `slate-dark-12` |
| `--ds-color-overlay` | `slate-a9` | `slate-a11` |

## Scales

Space and font sizes are pixels; everything else carries its unit. Breakpoints are minimum widths: the responsive props and `@custom-media (--ds-md)` apply from that width up.

**Space (px)**

| Token | Custom property | Value |
| --- | --- | --- |
| `none` | `--ds-space-none` | `0` |
| `xxs` | `--ds-space-xxs` | `1` |
| `xs` | `--ds-space-xs` | `2` |
| `sm` | `--ds-space-sm` | `4` |
| `md` | `--ds-space-md` | `8` |
| `lg` | `--ds-space-lg` | `16` |
| `xl` | `--ds-space-xl` | `32` |
| `xxl` | `--ds-space-xxl` | `64` |
| `xxxl` | `--ds-space-xxxl` | `128` |
| `xxxxl` | `--ds-space-xxxxl` | `256` |
| `xxxxxl` | `--ds-space-xxxxxl` | `512` |

**Font sizes (px)**

| Token | Custom property | Value |
| --- | --- | --- |
| `body` | `--ds-font-size-body` | `16` |
| `heading` | `--ds-font-size-heading` | `24` |
| `code` | `--ds-font-size-code` | `14` |
| `xxs` | `--ds-font-size-xxs` | `10` |
| `xs` | `--ds-font-size-xs` | `12` |
| `sm` | `--ds-font-size-sm` | `14` |
| `md` | `--ds-font-size-md` | `16` |
| `lg` | `--ds-font-size-lg` | `20` |
| `xl` | `--ds-font-size-xl` | `24` |
| `xxl` | `--ds-font-size-xxl` | `32` |
| `xxxl` | `--ds-font-size-xxxl` | `48` |
| `xxxxl` | `--ds-font-size-xxxxl` | `64` |
| `xxxxxl` | `--ds-font-size-xxxxxl` | `96` |

**Font weights**

| Token | Custom property | Value |
| --- | --- | --- |
| `body` | `--ds-font-weight-body` | `400` |
| `medium` | `--ds-font-weight-medium` | `500` |
| `heading` | `--ds-font-weight-heading` | `600` |
| `bold` | `--ds-font-weight-bold` | `700` |
| `semibold` | `--ds-font-weight-semibold` | `600` |

**Line heights**

| Token | Custom property | Value |
| --- | --- | --- |
| `body` | `--ds-line-height-body` | `1.5` |
| `heading` | `--ds-line-height-heading` | `1.125` |

**Font stacks**

| Token | Custom property | Value |
| --- | --- | --- |
| `body` | `--ds-font-body` | `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif` |
| `heading` | `--ds-font-heading` | `system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif` |
| `monospace` | `--ds-font-monospace` | `ui-monospace, SFMono-Regular, Menlo, Consolas, monospace` |

**Measures**

| Token | Custom property | Value |
| --- | --- | --- |
| `sm` | `--ds-measure-sm` | `26rem` |
| `md` | `--ds-measure-md` | `38rem` |
| `lg` | `--ds-measure-lg` | `46rem` |

**Breakpoints**

| Token | Custom property | Value |
| --- | --- | --- |
| `sm` | `--ds-breakpoint-sm` | `40rem` |
| `md` | `--ds-breakpoint-md` | `48rem` |
| `lg` | `--ds-breakpoint-lg` | `64rem` |
| `xl` | `--ds-breakpoint-xl` | `80rem` |

**Border radius**

| Token | Custom property | Value |
| --- | --- | --- |
| `none` | `--ds-border-radius-none` | `0` |
| `button` | `--ds-border-radius-button` | `4px` |
| `pill` | `--ds-border-radius-pill` | `9999px` |
| `circle` | `--ds-border-radius-circle` | `50%` |
| `sm` | `--ds-border-radius-sm` | `4px` |
| `md` | `--ds-border-radius-md` | `8px` |
| `xl` | `--ds-border-radius-xl` | `12px` |
| `xxl` | `--ds-border-radius-xxl` | `16px` |
| `xxxl` | `--ds-border-radius-xxxl` | `24px` |

**Border widths**

| Token | Custom property | Value |
| --- | --- | --- |
| `none` | `--ds-border-width-none` | `0` |
| `sm` | `--ds-border-width-sm` | `1px` |
| `md` | `--ds-border-width-md` | `2px` |
| `lg` | `--ds-border-width-lg` | `4px` |

**Shadows**

| Token | Custom property | Value |
| --- | --- | --- |
| `sm` | `--ds-shadow-sm` | `0 1px 2px var(--ds-slate-a3)` |
| `md` | `--ds-shadow-md` | `0 1px 2px var(--ds-slate-a3), 0 4px 12px var(--ds-slate-a4)` |
| `lg` | `--ds-shadow-lg` | `0 4px 8px var(--ds-slate-a3), 0 16px 40px var(--ds-slate-a6)` |

**Z-index**

| Token | Custom property | Value |
| --- | --- | --- |
| `dropdown` | `--ds-z-dropdown` | `1000` |
| `sticky` | `--ds-z-sticky` | `1100` |
| `drawer` | `--ds-z-drawer` | `1200` |
| `overlay` | `--ds-z-overlay` | `1300` |
| `modal` | `--ds-z-modal` | `1400` |
| `toast` | `--ds-z-toast` | `1500` |

**Durations**

| Token | Custom property | Value |
| --- | --- | --- |
| `instant` | `--ds-duration-instant` | `1ms` |
| `fast` | `--ds-duration-fast` | `100ms` |
| `normal` | `--ds-duration-normal` | `200ms` |
| `slow` | `--ds-duration-slow` | `300ms` |

**Easings**

| Token | Custom property | Value |
| --- | --- | --- |
| `standard` | `--ds-easing-standard` | `cubic-bezier(0.2, 0, 0, 1)` |
| `emphasized` | `--ds-easing-emphasized` | `cubic-bezier(0.16, 1, 0.3, 1)` |
| `linear` | `--ds-easing-linear` | `linear` |

**Control heights**

| Token | Custom property | Value |
| --- | --- | --- |
| `sm` | `--ds-control-height-sm` | `28px` |
| `md` | `--ds-control-height-md` | `32px` |
| `lg` | `--ds-control-height-lg` | `40px` |

**Icon sizes**

| Token | Custom property | Value |
| --- | --- | --- |
| `sm` | `--ds-icon-size-sm` | `16px` |
| `md` | `--ds-icon-size-md` | `20px` |

**Layout**

| Token | Custom property | Value |
| --- | --- | --- |
| `sidebar-width` | `--ds-sidebar-width` | `280px` |
