Foundations
Accessibility
Target: WCAG 2.2 Level AA, in both themes, at every breakpoint. Where the kit already exceeds a requirement, the stricter value is the requirement.
What the kit guarantees
- Contrast. All text clears 4.5:1 in both themes; interactive boundaries and state indicators clear 3:1. Run
npm run auditto re-verify after any token change. - Colour is never alone. Status pairs hue with an icon and a label, validity pairs it with a message, and the current item pairs it with a fill or a marker.
- Focus. The browser ring is removed globally and replaced globally — 2px of
--lb-focusat 2px offset, concentric viaborder-radius: inherit, at:focus-visibleonly. Grouped controls draw one ring on the group. - Targets. A 44px floor everywhere, past the 24px WCAG 2.5.8 requirement. The 34px pill takes vertical margin so its spacing-inclusive target still clears 44px.
- Keyboard. Every control is reachable and operable in DOM order, with no positive
tabindex. Composite widgets follow the APG pattern documented on each component. - Motion.
prefers-reduced-motionis honoured globally and every still state is the finished state, never a mid-transition frame. - Forced colours. Backgrounds and shadows are dropped and boundaries fall back to
CanvasText. - Live regions. One polite region for the whole kit.
role="alert"is reserved for errors a person must act on, and retries update the same node rather than stacking alerts.
WCAG 2.2 additions, explicitly
| Criterion | How the kit satisfies it |
|---|---|
| 2.4.11 Focus Not Obscured | scroll-margin-top at --lb-scroll-offset on every anchor target, so a sticky host header cannot cover a focused element. |
| 2.4.13 Focus Appearance | A 2px indicator at 2px offset, ≥17:1 against every adjacent surface in both themes. |
| 2.5.7 Dragging Movements | Nothing requires a drag: the carousel has explicit previous and next controls, and the rating is arrow-key operable. |
| 2.5.8 Target Size | A 44px floor at every breakpoint. |
| 3.2.6 Consistent Help | Contact and FAQ components keep their position across pages when placed by the page renderer. |
| 3.3.7 Redundant Entry | Capture forms preserve what was typed on a failed submit rather than clearing it. |
| 3.3.8 Accessible Authentication | No field in the kit blocks paste or autofill. |
What the kit needs from you
- Write real alt text. The kit passes
altthrough untouched and defaults to""only where an image is genuinely decorative. - Keep one h1.
profile-headerandheroemit an h1 by default; setheadingLevelto 2 when the host page already has one. - Label icon-only controls.
icon-linkrequires alabeland warns without one. - Do not remove the focus ring. If you restyle it, replace it —
--lb-focusis the single token to change. - Test the floor. A keyboard-only pass, a screen-reader pass, 200% zoom, 400% zoom reflow, both themes, reduced motion, forced colours, and axe-core with zero violations.