Blocks Design System

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
TokenLightDark
--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)
TokenCustom propertyValue
none--ds-space-none0
xxs--ds-space-xxs1
xs--ds-space-xs2
sm--ds-space-sm4
md--ds-space-md8
lg--ds-space-lg16
xl--ds-space-xl32
xxl--ds-space-xxl64
xxxl--ds-space-xxxl128
xxxxl--ds-space-xxxxl256
xxxxxl--ds-space-xxxxxl512
Font sizes (px)
TokenCustom propertyValue
body--ds-font-size-body16
heading--ds-font-size-heading24
code--ds-font-size-code14
xxs--ds-font-size-xxs10
xs--ds-font-size-xs12
sm--ds-font-size-sm14
md--ds-font-size-md16
lg--ds-font-size-lg20
xl--ds-font-size-xl24
xxl--ds-font-size-xxl32
xxxl--ds-font-size-xxxl48
xxxxl--ds-font-size-xxxxl64
xxxxxl--ds-font-size-xxxxxl96
Font weights
TokenCustom propertyValue
body--ds-font-weight-body400
medium--ds-font-weight-medium500
heading--ds-font-weight-heading600
bold--ds-font-weight-bold700
semibold--ds-font-weight-semibold600
Line heights
TokenCustom propertyValue
body--ds-line-height-body1.5
heading--ds-line-height-heading1.125
Font stacks
TokenCustom propertyValue
body--ds-font-bodysystem-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif
heading--ds-font-headingsystem-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif
monospace--ds-font-monospaceui-monospace, SFMono-Regular, Menlo, Consolas, monospace
Measures
TokenCustom propertyValue
sm--ds-measure-sm26rem
md--ds-measure-md38rem
lg--ds-measure-lg46rem
Breakpoints
TokenCustom propertyValue
sm--ds-breakpoint-sm40rem
md--ds-breakpoint-md48rem
lg--ds-breakpoint-lg64rem
xl--ds-breakpoint-xl80rem
Border radius
TokenCustom propertyValue
none--ds-border-radius-none0
button--ds-border-radius-button4px
pill--ds-border-radius-pill9999px
circle--ds-border-radius-circle50%
sm--ds-border-radius-sm4px
md--ds-border-radius-md8px
xl--ds-border-radius-xl12px
xxl--ds-border-radius-xxl16px
xxxl--ds-border-radius-xxxl24px
Border widths
TokenCustom propertyValue
none--ds-border-width-none0
sm--ds-border-width-sm1px
md--ds-border-width-md2px
lg--ds-border-width-lg4px
Shadows
TokenCustom propertyValue
sm--ds-shadow-sm0 1px 2px var(--ds-slate-a3)
md--ds-shadow-md0 1px 2px var(--ds-slate-a3), 0 4px 12px var(--ds-slate-a4)
lg--ds-shadow-lg0 4px 8px var(--ds-slate-a3), 0 16px 40px var(--ds-slate-a6)
Z-index
TokenCustom propertyValue
dropdown--ds-z-dropdown1000
sticky--ds-z-sticky1100
drawer--ds-z-drawer1200
overlay--ds-z-overlay1300
modal--ds-z-modal1400
toast--ds-z-toast1500
Durations
TokenCustom propertyValue
instant--ds-duration-instant1ms
fast--ds-duration-fast100ms
normal--ds-duration-normal200ms
slow--ds-duration-slow300ms
Easings
TokenCustom propertyValue
standard--ds-easing-standardcubic-bezier(0.2, 0, 0, 1)
emphasized--ds-easing-emphasizedcubic-bezier(0.16, 1, 0.3, 1)
linear--ds-easing-linearlinear
Control heights
TokenCustom propertyValue
sm--ds-control-height-sm28px
md--ds-control-height-md32px
lg--ds-control-height-lg40px
Icon sizes
TokenCustom propertyValue
sm--ds-icon-size-sm16px
md--ds-icon-size-md20px
Layout
TokenCustom propertyValue
sidebar-width--ds-sidebar-width280px