domestic-ui GitHub

Accessibility baseline: WCAG 2.2 AA

Every example must pass, and every token pair is tested against, these criteria:

TopicRuleSource
Text contrast4.5:1 for body text, in light and dark1.4.3 Contrast (Minimum)
Non-text contrast3: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:11.4.11 Non-text Contrast
LinksLinks keep their underline; color is never the only cue1.4.1 Use of Color
Focus visibleEvery focusable element shows a :focus-visible outline2.4.7 Focus Visible
Focus not obscuredscroll-padding keeps focused elements clear of sticky edges2.4.11 Focus Not Obscured (Minimum)
Focus appearance (AAA, optional)The default 3px solid ring at 3:1, hugging the edge, aims to meet it2.4.13 Focus Appearance
Target sizeControls 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 minimum2.5.8 Target Size (Minimum)
Reduced motionUnder 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 schemecolor-scheme: light dark plus light-dark() in every semantic colorMDN color-scheme
Forced colorsBorders and outlines switch to system colorsMDN 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> and th with scope (W3C tables tutorial).
  • Images: meaningful alt text (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 with data-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.

Search