shtukbasehub

Accessibility to WCAG 2.2 AA

Contrast of text/background pairs from the theme's CSS variables by the WCAG formula, alt on images, field labels, button names, heading order, lang on the page; color as the only signal and the keyboard are left to a judge.

Packagedesign-a11yv0.1.020 files

Accessibility to WCAG 2.2 AA

Accessibility norms for a project with an interface: web pages, React, HTML lenses. Checks on the project's code (HTML, TSX, JSX, CSS) hold six norms; a judge holds two.

What it installs

  • The page Accessibility: norms, settings (minContrast, custom color pairs), what programs cannot see.
  • Norms:
    • A11Y-R01: theme text contrast is at least 4.5:1 in all schemes; the contrast check computes it by the WCAG formula from CSS variables (--x-foreground on --x, --on-x on --x, custom pairs).
    • A11Y-R02: an <img> has alt; the alt check.
    • A11Y-R03: a form field has a label; the labels check.
    • A11Y-R04: a button and a link have a name; the names check.
    • A11Y-R05: headings of an HTML page are in order, one h1; the headings check.
    • A11Y-R06: <html> has lang; the lang check.
    • A11Y-R07: color is not the only signal; the judge judges/color-alone.md.
    • A11Y-R08: keyboard, focus, 24 px target size, 3:1 border contrast, structure of the assembled page; the judge judges/keyboard-and-structure.md.

The checks stand on the library of the design-base package; where they look for files is on its page Which files the design checks look at.

Where the boundary is

  • The checks read code, not a running page. A label or name that arrives through {...props} or an expression is invisible to them: such places are skipped, not counted as violations. The package does not replace a full audit in a browser (axe, Lighthouse) and does not install one.
  • A program checks heading order only in HTML: in TSX it is assembled from different components, so a judge looks at it.
  • Level AAA is not required; the contrast threshold can be raised with the minContrast field.