Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Living wiki of UI design patterns and best practices built with Fumadocs, Next.js, and Base UI components.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
rules/a11y-reduced-motion-check.md
1---2title: Respect prefers-reduced-motion for Sound3impact: HIGH4tags: a11y, reduced-motion, sound5---67## Respect prefers-reduced-motion for Sound89Respect prefers-reduced-motion as proxy for sound sensitivity.1011**Incorrect (ignores preference):**1213```tsx14function playSound(name: string) {15audio.play();16}17```1819**Correct (checks preference):**2021```tsx22function playSound(name: string) {23const prefersReducedMotion = window.matchMedia(24"(prefers-reduced-motion: reduce)"25).matches;2627if (prefersReducedMotion) return;28audio.play();29}30```31