Reference
Design tokens
The 87 tokens of the baseline theme, with their values, read from wf theme --json. A theme names only the ones it changes.
theme Brand { color-primary: #3B82F6 }
The baseline
Every token a project starts with, by group, read from the compiler's baseline theme. A theme names only the ones it changes.
Colour
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
color-backdrop
|
rgb(0 0 0 / 0.5)
|
What dims the page behind a modal, a dialog, a sheet and a drawer |
Sidebar, Modal, Dialog, Sheet |
color-background
|
#FFFFFF
|
The page behind everything |
Navbar, Tooltip, Input, Select, Switch, FileUpload, Alert, Toast +13 |
color-border
|
#E2E8F0
|
A line between things: a field's edge, a divider, a card's border |
Divider, Navbar, Sidebar, Breadcrumb, Menu, Popover, Tabs, Card +37 |
color-danger
|
#EF4444
|
Failed, destructive, invalid: a danger button, an error message |
Menu, Badge, Button, IconButton, Dropdown, Input, Alert, Toast +5 |
color-info
|
#06B6D4
|
For information: an info badge or alert, a note callout |
Badge, Button, Alert, Toast, Icon, Callout, Markdown |
color-on-danger
|
#FFFFFF
|
Text and icons written on |
Badge, Button, Toast |
color-on-info
|
#FFFFFF
|
Text and icons written on |
Badge, Button, Toast |
color-on-primary
|
#FFFFFF
|
Text and icons written on |
Sidebar, Badge, Avatar, Button, Chip, Toggle, Pagination, Stepper +1 |
color-on-secondary
|
#FFFFFF
|
Text and icons written on |
Badge, Button |
color-on-success
|
#FFFFFF
|
Text and icons written on |
Badge, Button, Toast, Stepper |
color-on-warning
|
#000000
|
Text and icons written on |
Badge, Button, Toast |
color-primary
|
#3B82F6
|
The main tone: a primary button, a link, a focus ring, what is chosen or current |
Navbar, Sidebar, Link, Tabs, Badge, Avatar, Button, IconButton +35 |
color-secondary
|
#64748B
|
A quieter tone, for a secondary button or badge |
Badge, Button, Icon, Markdown |
color-success
|
#22C55E
|
Done, passing, saved: a success badge, alert or toast |
Badge, Button, Alert, Toast, Icon, Callout, Stat, Stepper +1 |
color-surface
|
#F8FAFC
|
What sits on the page: a card, a menu, a popover, a table header |
Navbar, Sidebar, Menu, Popover, Card, Table, Badge, Tag +25 |
color-text
|
#0F172A
|
The text |
Navbar, Sidebar, Breadcrumb, Menu, Popover, Tabs, Badge, Tooltip +19 |
color-text-muted
|
#64748B
|
Text that matters less: a hint, a caption, |
Navbar, Breadcrumb, Menu, Tabs, Table, List, Dropdown, Input +15 |
color-warning
|
#F59E0B
|
Needs attention: a warning badge or alert, a rating's stars |
Badge, Button, Alert, Toast, Icon, Callout, Rating, Markdown |
Spacing
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
spacing-2xl
|
clamp(2rem, 1.5rem + 2.5vw, 3rem)
|
A section's spacing, growing with the screen |
— |
spacing-3xl
|
clamp(2.5rem, 1.75rem + 3.75vw, 4rem)
|
A page's largest spacing, growing with the screen |
— |
spacing-lg
|
1.5rem
|
A large gap: |
Grid, Spacer, Navbar, Menu, Button, Dropdown, Dialog, OnThisPage +3 |
spacing-md
|
1rem
|
The usual gap: |
Grid, Spacer, Divider, Navbar, Sidebar, Menu, Tabs, Card +35 |
spacing-sm
|
0.5rem
|
A small gap: |
Grid, Spacer, Navbar, Sidebar, Menu, Popover, Tabs, Card +54 |
spacing-xl
|
clamp(1.5rem, 1.25rem + 1.25vw, 2rem)
|
An extra-large gap, growing with the screen |
Grid, Spacer, EmptyState, OnThisPage |
spacing-xs
|
0.25rem
|
The smallest gap: |
Grid, Spacer, Navbar, Sidebar, Breadcrumb, Menu, Tooltip, Tag +41 |
Font size
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
font-size-2xl
|
clamp(1.5rem, 1.25rem + 1.25vw, 2rem)
|
A heading ( |
— |
font-size-3xl
|
clamp(1.75rem, 1.38rem + 1.88vw, 2.5rem)
|
The page's heading ( |
— |
font-size-base
|
1rem
|
Body text |
Tabs, Button, IconButton, Input, Select, Checkbox, Radio |
font-size-lg
|
clamp(1.125rem, 1.06rem + 0.31vw, 1.25rem)
|
Large text: |
Navbar, Sidebar, Avatar, Button, IconButton, Input, Alert, Toast +3 |
font-size-sm
|
0.875rem
|
Small text: |
Navbar, Breadcrumb, Table, Avatar, Tag, Button, Input, Slider +16 |
font-size-xl
|
clamp(1.25rem, 1.13rem + 0.63vw, 1.5rem)
|
A small heading ( |
IconButton, Icon |
font-size-xs
|
0.75rem
|
The smallest text: a badge, a caption |
Sidebar, Menu, Badge, Avatar, Tooltip, Tag, Dropdown, Chip +1 |
Line height
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
line-height-loose
|
1.75
|
Line height for long reading |
— |
line-height-normal
|
1.5
|
Body text's line height |
— |
line-height-tight
|
1.25
|
Headings' line height |
— |
Radius
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
radius-full
|
9999px
|
A pill or a circle: |
Badge, Avatar, Button, Input, Switch, Progress, Chip |
radius-lg
|
1rem
|
Rounder corners: a modal, a sheet |
Button, Modal, Dialog, Sheet |
radius-md
|
0.5rem
|
The usual corners: a button, a field, a card |
Navbar, Sidebar, Menu, Popover, Card, Tag, Button, IconButton +26 |
radius-none
|
0
|
Square corners |
— |
radius-sm
|
0.25rem
|
Slightly rounded: a badge, a checkbox, code |
Tooltip, FileUpload, Modal, Carousel, Code, Kbd, Listbox, Tree +6 |
radius-xl
|
1.5rem
|
Very round corners |
— |
Shadow
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
shadow-lg
|
0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)
|
A popover, a dropdown, a toast |
Menu, Popover, Dropdown, Toast, NavigationMenu, HoverCard, Tour, ConsentBanner +3 |
shadow-md
|
0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)
|
|
Card, Fab |
shadow-none
|
none
|
No shadow |
— |
shadow-sm
|
0 1px 2px 0 rgba(0,0,0,0.05)
|
A slight lift: a button, a field |
Switch, Sticky |
shadow-xl
|
0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)
|
A modal, a dialog, a sheet |
Modal, Dialog, Sheet |
Transition
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
transition-fast
|
150ms ease
|
A quick change: a hover, a press |
Navbar, Sidebar, Menu, Tabs, Button, IconButton, Dropdown, Input +8 |
transition-normal
|
250ms ease
|
The usual change: an open, a slide |
Sheet, Progress, Carousel, Accordion |
transition-slow
|
350ms ease
|
A deliberate change |
— |
Font
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
font-family
|
system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif
|
The text's typeface |
Tabs, Button, Input, Select, Toast |
font-family-mono
|
ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace
|
Code's typeface: |
Code, CodeBlock, Kbd, ColorPicker, Markdown |
font-weight-bold
|
700
|
|
Navbar, Sidebar, Link, Table, Avatar, Toast, Callout, EmptyState +10 |
font-weight-medium
|
500
|
A label's or a button's weight |
Navbar, Breadcrumb, Tabs, Badge, Button, Input, Slider, Accordion +6 |
font-weight-normal
|
400
|
Body text's weight |
— |
Motion
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
animation-duration-fast
|
150ms
|
|
Modal, Dialog |
animation-duration-normal
|
300ms
|
An animation's length when it says nothing |
— |
animation-duration-slow
|
500ms
|
|
— |
animation-easing-bounce
|
cubic-bezier(0.68, -0.55, 0.265, 1.55)
|
|
— |
animation-easing-default
|
cubic-bezier(0.4, 0, 0.2, 1)
|
An animation's easing when it says nothing |
— |
animation-easing-spring
|
cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
— |
ease-in
|
cubic-bezier(0.4, 0, 1, 1)
|
|
— |
ease-out
|
cubic-bezier(0, 0, 0.2, 1)
|
|
— |
ease-spring
|
linear(0, 0.006, 0.079, 0.234, 0.44, 0.652, 0.828, 0.947, 1.008, 1.025, 1.016, 1)
|
A spring that overshoots and settles |
— |
ease-standard
|
cubic-bezier(0.2, 0, 0, 1)
|
|
Modal, Dialog |
Other
| Token | Value | What it is for | Built-ins that draw from it |
|---|---|---|---|
screen-lg
|
1024px
|
Where |
— |
screen-md
|
768px
|
Where |
— |
screen-sm
|
640px
|
Where |
— |
screen-xl
|
1280px
|
Where |
— |
syntax-comment
|
#959BA1
|
|
Highlight |
syntax-function
|
#6FD3E6
|
|
Highlight |
syntax-keyword
|
#8FBDE7
|
|
Highlight |
syntax-number
|
#E0B070
|
|
Highlight |
syntax-punct
|
#B3BAC0
|
|
Highlight |
syntax-string
|
#7FD6A8
|
|
Highlight |
target-min
|
24px
|
The least size of anything a pointer presses (WCAG 2.2's 24px) |
Link, Menu, Tag, Checkbox, Radio, Switch, Slider, Alert +22 |
target-min-touch
|
44px
|
The least size of anything a finger presses (44px) |
BottomNavigation, Lightbox, Fab, BackToTop |
term-bg
|
#1B1F22
|
A terminal block's background |
Code, CodeBlock, Markdown |
term-dim
|
#959BA1
|
A terminal block's quieter text: a prompt, a comment |
CodeBlock, Highlight |
term-ink
|
#E6E9EC
|
A terminal block's text |
Code, CodeBlock, Markdown |
wf-header-height
|
56px
|
How far a sticky element sits below the page's sticky header |
Sidebar |
z-drawer
|
200
|
Where a drawer, a |
Sidebar |
z-dropdown
|
1000
|
Where a dropdown not in the top layer stacks |
NavigationMenu |
z-modal
|
1300
|
Where a modal not in the top layer stacks |
— |
z-skip-link
|
10000
|
Where the skip link stacks, above everything |
— |
z-sticky
|
100
|
Where a sticky header or |
Navbar, AppShell, BottomNavigation, Sticky, Fab, BackToTop |
z-toast
|
1400
|
Where the toasts stack |
Toast, ConsentBanner |
z-tooltip
|
1500
|
Where a tooltip not in the top layer stacks |
— |
This chapter lists every design token of the baseline theme with its value, and how a style reads one. A design token is a named value — a colour, a size, a duration — that every built-in is drawn with. Change a token and every element drawn with it changes.
A theme declaration changes the tokens it names and keeps the baseline value of every other one. A theme may also add tokens of its own. Each token becomes a CSS custom property on :root:
theme Brand {
color-primary: #0F766E
radius-md: 14px
screen-md: 900px
surface-raised: #F1F5F9
}
The build writes to :root only the tokens something in the output names, and the tokens those name in turn.
Reading a token
A token has two spellings, one for each place a style is written:
| Where | Syntax | Example |
|---|---|---|
|
A |
|
|
|
A |
|
|
|
A |
|
|
This page reads the tokens of the theme above — one the theme adds, one it changes, one it keeps, and a breakpoint it moves:
theme Brand {
color-primary: #0F766E
radius-md: 14px
screen-md: 900px
surface-raised: #F1F5F9
}
page Pricing(path: "/pricing", title: "Pricing", description: "Plans and prices for every team.") {
Heading("Pricing").h1
Card {
style {
background: $surface-raised
padding: $lg
border-radius: $md
border: 1px solid $border
@md { padding: $xl }
}
Text("Team plan").bold
}
}
The card's background is #F1F5F9, its radius 14px and its border the baseline color-border. Its padding grows to spacing-xl from 900px wide, because @md reads screen-md.
A $token the resolved theme does not declare draws the V06 warning, since the property would fall back to nothing. wf theme lists every token the build uses, where each is read, and the contrast of the colour pairs (Command line).
Every built-in follows the theme
The built-ins draw their colours, sizes, radii, fonts and motion from these tokens and nothing else, so a theme restyles every one of them, the ones a page adds later included. A tone's label is a token too: color-on-primary is what a primary button, badge, pressed toggle, current page or selected day writes on color-primary, and so for secondary, success, danger, warning and info. A theme with a light primary names a dark color-on-primary, and A13 holds each pair to WCAG AA where a page draws it. An alert's tint, a focus ring and a highlighted match are worked out from the tone and the page's colours (color-mix), so a dark theme gets dark alerts without naming any; color-backdrop dims the page behind a modal, a dialog, a sheet and a drawer. The only colours that stay fixed are the ones over a picture: a carousel's and a lightbox's controls.
Short names
In a style { } block, a short name is resolved through the group of the property it is given to: $lg on padding is spacing-lg, and on border-radius it is radius-lg.
| Property | Group | Short names | Example |
|---|---|---|---|
|
|
spacing |
|
|
|
|
colour |
|
|
|
|
font size |
|
|
|
|
line height |
|
|
|
|
radius |
|
|
|
|
shadow |
|
|
|
|
transition |
|
|
A short name your theme declares as a token of its own means that token, not the group's: with md: 20px in the theme, $md is md everywhere.
A full name — $color-text-muted, $spacing-lg, a token of your own — works in any property.