fix(a11y): add prefers-reduced-motion guard to panel animations (#8)#18
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a media query for prefers-reduced-motion: reduce in panel.css to disable animations for several UI elements like spinners and indicators. The review feedback points out a redundant border-top-color definition on the .spinner class within this media query that can be safely removed.
| .spinner { | ||
| animation: none; | ||
| border-top-color: var(--accent-blue); | ||
| } |
hoainho
left a comment
There was a problem hiding this comment.
🎉 Textbook PR @Kunall7890. Single file, single concern, comprehensive coverage — you even caught .loading-text which I didn't mention. The DevTools Ctrl+Shift+P → "Emulate CSS prefers-reduced-motion: reduce" test instructions are sharp; that's the right manual-test path.
A11y fix verified:
- ✅ All 6 animated classes (
scan-indicator,spinner,mini-spinner,saving-indicator,btn-spinner,loading-text) getanimation: noneunder reduce-motion - ✅
.spinnerkeeps aborder-top-color: var(--accent-blue)so the static indicator still reads as "loading" via color (good touch) - ✅ No regression on default — only the
@media (prefers-reduced-motion: reduce)block is added; original animations untouched - ✅
Closes #8reference - ✅ Scope discipline this time
Approving. Thanks for the clean split from PR #15 — this is the contribution pattern we want to see.
Summary
Fixes #8
Users who have "Reduce Motion" enabled in their OS/browser
accessibility settings were still seeing pulsing animations
in the extension panel, which can cause discomfort or harm
for users with vestibular disorders.
Changes
Single file changed:
src/panel/styles/panel.cssAdded
@media (prefers-reduced-motion: reduce)block thatdisables the following animations:
.scan-indicatorpulse.spinnerspin.mini-spinnermini-spin.saving-indicatorpulse-opacity.btn-spinnermini-spin.loading-textpulse-opacityWhat stays the same
How to test
npm run builddist/in Chrome →chrome://extensions→ Load unpackedCtrl+Shift+P→ typereduced motionAcceptance Criteria
Closes #8