Accessibility baseline: WCAG 2.2 AA
Every example must pass, and every token pair is tested against, these criteria:
| Topic | Rule | Source |
|---|---|---|
| Text contrast | 4.5:1 for body text, in light and dark | 1.4.3 Contrast (Minimum) |
| Non-text contrast | 3:1 for the boundaries of fields, selects, checkboxes, radios and switches, and for the focus indicator. A button with a visible text label is identified by its label, so its border is not required to reach 3:1 | 1.4.11 Non-text Contrast |
| Links | Links keep their underline; color is never the only cue | 1.4.1 Use of Color |
| Focus visible | Every focusable element shows a :focus-visible outline | 2.4.7 Focus Visible |
| Focus not obscured | scroll-padding keeps focused elements clear of sticky edges | 2.4.11 Focus Not Obscured (Minimum) |
| Focus appearance (AAA, optional) | The default 3px solid ring at 3:1, hugging the edge, aims to meet it | 2.4.13 Focus Appearance |
| Target size | Controls are at least 36px tall and rows 32px (32px and 28px with data-density="compact", see Density; 44px under a coarse pointer), above the 24px minimum | 2.5.8 Target Size (Minimum) |
| Reduced motion | Under prefers-reduced-motion: reduce movement stops and fades stay; data-motion="none" turns transitions off (see Motion) | MDN prefers-reduced-motion, 2.3.3 Animation from Interactions |
| Color scheme | color-scheme: light dark plus light-dark() in every semantic color | MDN color-scheme |
| Forced colors | Borders and outlines switch to system colors | MDN forced-colors |
- Never remove an outline without a visible replacement.
- Forms: every control has a
<label>. Groups use<fieldset>and<legend>(W3C forms tutorial). - Tables: a
<caption>andthwithscope(W3C tables tutorial). - Images: meaningful
alttext (W3C images tutorial). - Force a scheme on the page or any subtree with
data-color-scheme="light"or"dark", or flip a band to the other scheme from the page around it withdata-surface="inverse". Use these, not hand-set color tokens, for a dark band on a light page. Tokens derived from the text color (muted text, hairlines, links) follow the scheme, not a hand-set--dui-color-text.