Design tokens
Semantic tokens as CSS variables. Use these instead of raw values: colors and shadows switch for dark mode by themselves, and sizes follow the density you choose.
Elevation
Four shadow levels, defined once. Components use them by name, so a popover, a dialog and a menu always feel related, and changing the look of depth is one edit. In dark mode each level uses a deeper shadow with a faint light edge, because a dark shadow barely shows on a dark surface.
--rd-elevation-controlFilled buttons and checked boxes: a lit top edge and a small drop.--rd-elevation-raisedResting controls, cards and the selected tab.--rd-elevation-floatingMenus, listboxes, tooltips and toasts.--rd-elevation-overlayDialogs, sheets and the command palette.
.menu { box-shadow: var(--rd-elevation-floating); }Density
Control heights and padding come from tokens too. Put data-density="compact" on <html>, or on any container, and everything inside tightens. Use it for data-heavy admin screens; leave it off for marketing pages and forms people fill in once.
<html data-density="compact">
<section data-density="compact">…</section>All tokens
| Token | CSS variable | Light | Dark |
|---|---|---|---|
| color.action.primary | --rd-color-action-primary | #c2410c | #fb923c |
| color.action.primary-hover | --rd-color-action-primary-hover | #9a3412 | #fdba74 |
| color.action.on-primary | --rd-color-action-on-primary | #ffffff | #12100e |
| color.action.danger | --rd-color-action-danger | #dc2626 | #f87171 |
| color.action.danger-hover | --rd-color-action-danger-hover | #b91c1c | #fca5a5 |
| color.surface.default | --rd-color-surface-default | #ffffff | #12100e |
| color.surface.subtle | --rd-color-surface-subtle | #f2efe9 | #2c2925 |
| color.surface.raised | --rd-color-surface-raised | #ffffff | #1c1a17 |
| color.surface.selected | --rd-color-surface-selected | #fff4ec | #431407 |
| color.border.default | --rd-color-border-default | #e4e0d8 | #2c2925 |
| color.border.strong | --rd-color-border-strong | #857f75 | #857f75 |
| color.feedback.danger | --rd-color-feedback-danger | #dc2626 | #f87171 |
| color.feedback.success | --rd-color-feedback-success | #16a34a | #4ade80 |
| color.feedback.warning | --rd-color-feedback-warning | #b45309 | #fbbf24 |
| color.feedback.info | --rd-color-feedback-info | #2563eb | #60a5fa |
| color.feedback.danger-subtle | --rd-color-feedback-danger-subtle | #fef2f2 | #2a1a1d |
| color.feedback.success-subtle | --rd-color-feedback-success-subtle | #f0fdf4 | #15271f |
| color.feedback.warning-subtle | --rd-color-feedback-warning-subtle | #fffbeb | #2a2314 |
| color.feedback.info-subtle | --rd-color-feedback-info-subtle | #eff6ff | #18202e |
| color.overlay.backdrop | --rd-color-overlay-backdrop | rgb(14 14 18 / 0.5) | rgb(0 0 0 / 0.6) |
| color.text.default | --rd-color-text-default | #1c1a17 | #faf8f5 |
| color.text.muted | --rd-color-text-muted | #5c574f | #a39e94 |
| color.focus.ring | --rd-color-focus-ring | #ea580c | #fdba74 |
| color.chart.1 | --rd-color-chart-1 | #c2410c | #fb923c |
| color.chart.2 | --rd-color-chart-2 | #2563eb | #60a5fa |
| color.chart.3 | --rd-color-chart-3 | #15803d | #4ade80 |
| color.chart.4 | --rd-color-chart-4 | #7c3aed | #a78bfa |
| color.chart.5 | --rd-color-chart-5 | #0e7490 | #22d3ee |
| color.chart.6 | --rd-color-chart-6 | #be185d | #f472b6 |
| radius.control | --rd-radius-control | 10px | 10px |
| radius.overlay | --rd-radius-overlay | 14px | 14px |
| radius.media | --rd-radius-media | 24px | 24px |
| space.control-x | --rd-space-control-x | 16px | 16px |
| space.control-x-sm | --rd-space-control-x-sm | 12px | 12px |
| space.control-x-lg | --rd-space-control-x-lg | 20px | 20px |
| elevation.control | --rd-elevation-control | inset 0 1px 0 rgb(255 255 255 / 0.16), 0 1px 2px rgb(28 26 23 / 0.22) | inset 0 1px 0 rgb(255 255 255 / 0.2), 0 1px 2px rgb(0 0 0 / 0.5) |
| elevation.raised | --rd-elevation-raised | 0 1px 2px rgb(28 26 23 / 0.06), 0 1px 1px rgb(28 26 23 / 0.04) | 0 1px 2px rgb(0 0 0 / 0.4), 0 0 0 1px rgb(255 255 255 / 0.03) |
| elevation.floating | --rd-elevation-floating | 0 8px 24px -6px rgb(28 26 23 / 0.18), 0 0 0 1px rgb(28 26 23 / 0.04) | 0 8px 24px -6px rgb(0 0 0 / 0.6), 0 0 0 1px rgb(255 255 255 / 0.07) |
| elevation.overlay | --rd-elevation-overlay | 0 24px 64px -16px rgb(28 26 23 / 0.35), 0 0 0 1px rgb(28 26 23 / 0.05) | 0 24px 64px -16px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.08) |
| size.control-sm | --rd-size-control-sm | 32px | 32px |
| size.control-md | --rd-size-control-md | 40px | 40px |
| size.control-lg | --rd-size-control-lg | 48px | 48px |