Skip to content
Design System
GitHub

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
    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.

36 · with a mouse only, at any density (44 on touch)
44 · minimum
48 · primary actions
56 · emergency stop (64 in glove density; never smaller)

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.

Focused buttonResting button

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
SendingLow batteryMotor fault
  • 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.