Add WCAG 2.1 Level AA accessibility across all components
A break timer designed to prevent RSI should be usable by people who already live with disabilities. This overhaul adds comprehensive accessibility without changing the visual design. Changes across 17 source files: - Global focus-visible outlines, sr-only utility, forced-colors support - prefers-reduced-motion kills all CSS animations AND JS Web Animations - All text upgraded to 4.5:1+ contrast ratio (WCAG AA) - Keyboard navigation for ColorPicker, Stepper, TimeSpinner - Screen reader: aria-live status regions, progressbar roles, labeled controls, sr-only chart data table, focus management on view changes - Focus trap on break screen, aria-hidden on decorative elements - Descriptive labels on all 25+ toggle/stepper instances in Settings - README updated with accessibility section and WCAG badge
This commit is contained in:
50
src/app.css
50
src/app.css
@@ -14,7 +14,7 @@
|
||||
--color-warning: #f0a500;
|
||||
--color-danger: #f85149;
|
||||
--color-text-pri: #ffffff;
|
||||
--color-text-sec: #777777;
|
||||
--color-text-sec: #8a8a8a;
|
||||
--color-text-dim: #3a3a3a;
|
||||
--color-caption-bg: #050505;
|
||||
}
|
||||
@@ -55,3 +55,51 @@ body {
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
/* ── Accessibility: Screen-reader only ── */
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border-width: 0;
|
||||
}
|
||||
|
||||
/* ── Accessibility: Focus indicators ── */
|
||||
:focus-visible {
|
||||
outline: 2px solid var(--color-accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* ── Accessibility: Reduced motion ── */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*, *::before, *::after {
|
||||
animation-duration: 0.001ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.001ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Accessibility: Windows High Contrast ── */
|
||||
@media (forced-colors: active) {
|
||||
:root {
|
||||
--color-bg: Canvas;
|
||||
--color-surface: Canvas;
|
||||
--color-card: Canvas;
|
||||
--color-card-lt: Canvas;
|
||||
--color-border: ButtonBorder;
|
||||
--color-accent: Highlight;
|
||||
--color-accent-lt: Highlight;
|
||||
--color-text-pri: CanvasText;
|
||||
--color-text-sec: CanvasText;
|
||||
--color-text-dim: GrayText;
|
||||
--color-success: Highlight;
|
||||
--color-warning: Highlight;
|
||||
--color-danger: LinkText;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user