---
url: https://surgijs.github.io/surgijs/ui/tokens.md
---
# Design tokens

Every value in `@surgijs/ui/themes.css` comes from the token files in `packages/ui/tokens`, and the same files produce the Figma token sets in `packages/ui/tokens/figma`. A Figma variable takes the token path as its name, so `color/primary-hover` is `--s-color-primary-hover` in CSS.

Light values apply by default. Dark values apply under `data-theme="dark"` or, without a `data-theme` on the root, when the OS prefers dark.

## Typography

| Token | Value | Used for |
| --- | --- | --- |
| `--s-font-family` | `system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif` | Text in components. |
| `--s-font-size-sm` | `0.875rem` | Small text: the `sm` size of components. |
| `--s-font-size-md` | `1rem` | Default text size of components. |
| `--s-font-size-lg` | `1.125rem` | Large text: the `lg` size of components. |
| `--s-font-weight-medium` | `500` | Button labels. |

## Corners

| Token | Value | Used for |
| --- | --- | --- |
| `--s-radius-sm` | `4px` | Small corners. |
| `--s-radius-md` | `6px` | Default corners of components. |
| `--s-radius-lg` | `8px` | Large corners. |
| `--s-radius-full` | `999px` | Pill-shaped corners. |

## Motion

| Token | Value | Used for |
| --- | --- | --- |
| `--s-duration-fast` | `120ms` | Hover and press transitions. |

## Color

| Token | Light | Dark | Used for |
| --- | --- | --- | --- |
| `--s-color-primary` |  `#3451d1` |  `#4263eb` | Primary backgrounds. |
| `--s-color-primary-hover` |  `#2a43b3` |  `#3b5bdb` | Primary backgrounds on hover. |
| `--s-color-primary-active` |  `#223896` |  `#364fc7` | Primary backgrounds while pressed. |
| `--s-color-primary-text` |  `#3451d1` |  `#91a7ff` | Primary-colored text on surfaces. |
| `--s-color-on-primary` |  `#ffffff` |  `#ffffff` | Text on primary backgrounds. |
| `--s-color-danger` |  `#c92a2a` |  `#c92a2a` | Destructive action backgrounds. |
| `--s-color-danger-hover` |  `#a51f1f` |  `#b02525` | Destructive action backgrounds on hover. |
| `--s-color-danger-active` |  `#861818` |  `#962020` | Destructive action backgrounds while pressed. |
| `--s-color-on-danger` |  `#ffffff` |  `#ffffff` | Text on danger backgrounds. |
| `--s-color-surface` |  `#ffffff` |  `#1f2126` | Neutral backgrounds. |
| `--s-color-surface-hover` |  `#f1f3f5` |  `#2a2d34` | Neutral backgrounds on hover. |
| `--s-color-surface-active` |  `#e3e7eb` |  `#353943` | Neutral backgrounds while pressed. |
| `--s-color-text` |  `#1c1f26` |  `#e9ecef` | Text on surfaces. |
| `--s-color-border` |  `#c4c9d2` |  `#4a505c` | Outlines. |
| `--s-color-focus` |  `#4c6ef5` |  `#748ffc` | Focus rings. |
