Accessibility
Accessibility is part of the tokens, not a review step. Contrast below is computed from the theme file on every build.
Contrast
WCAG 2.2: AA needs 4.5:1 for text, 3:1 for large text (24 px, or 18.66 px (14 pt) bold) and UI parts.
| Foreground | Background | Use | Dark | Light |
|---|---|---|---|---|
foreground | background | Body text | 19.1:1AAA | 17.3:1AAA |
foreground | card | Text on cards | 17.3:1AAA | 19.9:1AAA |
muted-foreground | background | Secondary text | 7.8:1AAA | 6.7:1AA |
muted-foreground | card | Secondary text on cards | 7.0:1AAA | 7.7:1AAA |
primary-foreground | primary | Primary button | 19.1:1AAA | 19.9:1AAA |
info | info-subtle | Info badge | 6.3:1AA | 5.8:1AA |
success | success-subtle | Toast or alert confirmation | 7.5:1AAA | 5.1:1AA |
warning | warning-subtle | Warning badge | 10.9:1AAA | 5.2:1AA |
danger | danger-subtle | Danger badge | 5.1:1AA | 8.3:1AAA |
danger | background | Destructive button text | 6.3:1AA | 9.0:1AAA |
warning | background | Warning text in a page | 14.3:1AAA | 5.3:1AA |
warning | card | Warning text in a card | 12.9:1AAA | 6.1:1AA |
success | background | Success text in a page | 9.6:1AAA | 5.3:1AA |
success | card | Success text in a card | 8.7:1AAA | 6.1:1AA |
info | background | A process being waited on: progress, a running stage | 7.9:1AAA | 6.1:1AA |
white | stop | Emergency stop label | 4.8:1AA | 4.8:1AA |
foreground- Background
background- Use
- Body text
- Dark
- 19.1:1AAA
- Light
- 17.3:1AAA
foreground- Background
card- Use
- Text on cards
- Dark
- 17.3:1AAA
- Light
- 19.9:1AAA
muted-foreground- Background
background- Use
- Secondary text
- Dark
- 7.8:1AAA
- Light
- 6.7:1AA
muted-foreground- Background
card- Use
- Secondary text on cards
- Dark
- 7.0:1AAA
- Light
- 7.7:1AAA
primary-foreground- Background
primary- Use
- Primary button
- Dark
- 19.1:1AAA
- Light
- 19.9:1AAA
info- Background
info-subtle- Use
- Info badge
- Dark
- 6.3:1AA
- Light
- 5.8:1AA
success- Background
success-subtle- Use
- Toast or alert confirmation
- Dark
- 7.5:1AAA
- Light
- 5.1:1AA
warning- Background
warning-subtle- Use
- Warning badge
- Dark
- 10.9:1AAA
- Light
- 5.2:1AA
danger- Background
danger-subtle- Use
- Danger badge
- Dark
- 5.1:1AA
- Light
- 8.3:1AAA
danger- Background
background- Use
- Destructive button text
- Dark
- 6.3:1AA
- Light
- 9.0:1AAA
warning- Background
background- Use
- Warning text in a page
- Dark
- 14.3:1AAA
- Light
- 5.3:1AA
warning- Background
card- Use
- Warning text in a card
- Dark
- 12.9:1AAA
- Light
- 6.1:1AA
success- Background
background- Use
- Success text in a page
- Dark
- 9.6:1AAA
- Light
- 5.3:1AA
success- Background
card- Use
- Success text in a card
- Dark
- 8.7:1AAA
- Light
- 6.1:1AA
info- Background
background- Use
- A process being waited on: progress, a running stage
- Dark
- 7.9:1AAA
- Light
- 6.1:1AA
white- Background
stop- Use
- Emergency stop label
- Dark
- 4.8:1AA
- Light
- 4.8:1AA
The emergency stop label is 18 px bold, just under large text, so it is held to 4.5:1 and passes in every theme.
Target size
Anything interactive is at least 44 × 44 px (--h-md) on touch. With a mouse, compact controls may be 36 px (--h-sm) for dense tools; on touch screens --h-sm becomes 44 by itself, so the island, the dock and phone layouts are never smaller. Small visuals, like a 20 px checkbox, sit inside a 44 px row that is tappable as a whole.
Focus
Every focusable element shows a 2 px --ring outline with a 2 px offset on keyboard focus. It is set globally; do not remove it.
Density
One attribute sets how big every control is, because every height is a token. Put data-density on <html> for the whole app or on a container for one area; type and spacing stay the same. Glove for outdoor work in gloves, compact for a control-room console with a mouse.
no attribute · A bare finger: 44 px controls, 56 px rows.
- Patrol dog 7F3A
- Courier 2B19
High contrast
For a tablet in bright sun, glare on an outdoor robot's screen, and low vision. Put data-contrast="more" on <html> or on a container, in light or dark. Text and status reach 7:1 on every surface they sit on, field and card edges reach 3:1 so they show without their fill, and trays over the map turn opaque. Meanings stay the same: blue is still a process, solid red still only the stop.
data-contrast="more" · Bright sun and low vision: 7:1 text, 3:1 edges, nothing translucent.
- Patrol dog 7F3AHall BPatrolling
- Courier 2B19Hall BBattery 12 %
- Courier 4C02Hall BOffline
| Foreground | Background | Use | Dark | Light |
|---|---|---|---|---|
foreground | background | Body text | 21.0:1AAA | 21.0:1AAA |
foreground | card | Text on cards | 18.7:1AAA | 21.0:1AAA |
muted-foreground | background | Secondary text | 14.2:1AAA | 10.4:1AAA |
muted-foreground | card | Secondary text on cards | 12.7:1AAA | 10.4:1AAA |
primary-foreground | primary | Primary button | 21.0:1AAA | 21.0:1AAA |
info | info-subtle | Info badge | 9.0:1AAA | 8.2:1AAA |
success | success-subtle | Toast or alert confirmation | 9.7:1AAA | 8.6:1AAA |
warning | warning-subtle | Warning badge | 11.8:1AAA | 8.2:1AAA |
danger | danger-subtle | Danger badge | 8.4:1AAA | 10.1:1AAA |
danger | background | Destructive button text | 11.1:1AAA | 12.6:1AAA |
warning | background | Warning text in a page | 16.3:1AAA | 9.7:1AAA |
warning | card | Warning text in a card | 14.5:1AAA | 9.7:1AAA |
success | background | Success text in a page | 13.1:1AAA | 10.3:1AAA |
success | card | Success text in a card | 11.7:1AAA | 10.3:1AAA |
info | background | A process being waited on: progress, a running stage | 11.9:1AAA | 9.9:1AAA |
white | stop | Emergency stop label | 4.8:1AA | 4.8:1AA |
border | background | Card and divider edge | 6.1:1AA | 4.5:1AA large |
input | card | Field, checkbox and switch edge on a card | 7.3:1AAA | 6.6:1AA |
input | background | Field edge on the page | 8.2:1AAA | 6.6:1AA |
foreground- Background
background- Use
- Body text
- Dark
- 21.0:1AAA
- Light
- 21.0:1AAA
foreground- Background
card- Use
- Text on cards
- Dark
- 18.7:1AAA
- Light
- 21.0:1AAA
muted-foreground- Background
background- Use
- Secondary text
- Dark
- 14.2:1AAA
- Light
- 10.4:1AAA
muted-foreground- Background
card- Use
- Secondary text on cards
- Dark
- 12.7:1AAA
- Light
- 10.4:1AAA
primary-foreground- Background
primary- Use
- Primary button
- Dark
- 21.0:1AAA
- Light
- 21.0:1AAA
info- Background
info-subtle- Use
- Info badge
- Dark
- 9.0:1AAA
- Light
- 8.2:1AAA
success- Background
success-subtle- Use
- Toast or alert confirmation
- Dark
- 9.7:1AAA
- Light
- 8.6:1AAA
warning- Background
warning-subtle- Use
- Warning badge
- Dark
- 11.8:1AAA
- Light
- 8.2:1AAA
danger- Background
danger-subtle- Use
- Danger badge
- Dark
- 8.4:1AAA
- Light
- 10.1:1AAA
danger- Background
background- Use
- Destructive button text
- Dark
- 11.1:1AAA
- Light
- 12.6:1AAA
warning- Background
background- Use
- Warning text in a page
- Dark
- 16.3:1AAA
- Light
- 9.7:1AAA
warning- Background
card- Use
- Warning text in a card
- Dark
- 14.5:1AAA
- Light
- 9.7:1AAA
success- Background
background- Use
- Success text in a page
- Dark
- 13.1:1AAA
- Light
- 10.3:1AAA
success- Background
card- Use
- Success text in a card
- Dark
- 11.7:1AAA
- Light
- 10.3:1AAA
info- Background
background- Use
- A process being waited on: progress, a running stage
- Dark
- 11.9:1AAA
- Light
- 9.9:1AAA
white- Background
stop- Use
- Emergency stop label
- Dark
- 4.8:1AA
- Light
- 4.8:1AA
border- Background
background- Use
- Card and divider edge
- Dark
- 6.1:1AA
- Light
- 4.5:1AA large
input- Background
card- Use
- Field, checkbox and switch edge on a card
- Dark
- 7.3:1AAA
- Light
- 6.6:1AA
input- Background
background- Use
- Field edge on the page
- Dark
- 8.2:1AAA
- Light
- 6.6:1AA
Edges are UI parts, held to 3:1. To follow the system setting, set the attribute from matchMedia("(prefers-contrast: more)"); on a robot's own screen, offer it as a setting beside the appearance.
Checklist
- Status is a shape and a word; colour only when it is abnormal. Never colour alone.
- Every icon-only control has an accessible name.
- Errors say how to fix them and sit next to the field (
aria-describedby). - Hold and slide gestures have a keyboard alternative: hold Enter or Space for 2 s.
- Motion respects
prefers-reduced-motion. - Inputs use 16 px text so iOS does not zoom.