Accessibility
Meridian targets WCAG 2.2 AA. Most of that is decided by the token values, but a stylesheet can only do so much — the rest is a contract with whoever writes the markup.
What the tokens guarantee
| Pair | Light | Dark | Target |
|---|---|---|---|
| Text on background | 15.2:1 | 13.8:1 | 4.5:1 |
| Muted text on background | 4.9:1 | 4.7:1 | 4.5:1 |
| Accent on background | 5.6:1 | 6.1:1 | 4.5:1 |
| White on accent | 5.1:1 | — | 4.5:1 |
| Border on surface | 1.3:1 | 1.4:1 | non-text, decorative |
These numbers are asserted in CI: a test resolves every token pair and fails the build if a ratio drops below its target. Nobody checks contrast by eye in this repository.
Focus
Focus is always visible and never removed. The default is a 2px accent ring with a 2px offset,
drawn with :focus-visible so pointer users do not see it:
:focus-visible {
outline: 2px solid var(--mrd-accent);
outline-offset: 2px;
border-radius: var(--mrd-radius-sm);
}
outline: none
If a custom control needs a different focus treatment, replace the ring — do not delete it. A
keyboard user who cannot see where they are cannot use the interface at all.
Motion
Transitions are short (120–180ms) and only on colour, opacity and shadow. Nothing moves spatially, so there is no vestibular risk to mitigate — but the preference is still respected:
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
transition-duration: .01ms !important;
animation-duration: .01ms !important;
}
}
Semantics checklist
Before shipping a screen, these are the items that actually break:
- Every input has a
<label>bound withfor/id— placeholders are not labels. - Every button that contains only an icon has an accessible name (
aria-labelor visually hidden text). - Errors are announced: put the message in the DOM at render time, not in a toast that disappears in four seconds.
- Tables use
<th scope="col">; a table used for layout is a bug, not a shortcut. - Nothing important is conveyed by colour alone — a red badge also carries a word.
- The page has exactly one
<h1>and headings do not skip levels. - Touch targets are at least 24×24px, including the padding around a small icon.
Testing
The routine is: keyboard-only pass (Tab, Shift+Tab, Enter, Escape), then a screen reader pass on one desktop and one mobile reader, then automated checks. Automated tools catch roughly a third of real issues — they are a floor, not a finish line.