Skip to content

fix(rules): a library's reduced-motion block covers only the motion it names #2111 - #2165

Merged
nc9 merged 7 commits into
mainfrom
boat/reduced-motion-lib-2111
Nov 21, 2026
Merged

nc9 merged 7 commits into
mainfrom
boat/reduced-motion-lib-2111

Conversation

@nc9

@nc9 nc9 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Closes #2111.

a11y/reduced-motion no longer treats any @media (prefers-reduced-motion) rule as handling for the whole page. stylesheetMotionOf now records the selectors inside reduce blocks that set animation/transition/scroll-behavior (reducedMotionSelectors) and whether the block is a global reset (*, html, body, :root, or a no-preference block) (reducedMotionGlobal). Only a global reset, a media-gated sheet or a matchMedia script handles the whole page; otherwise a CSS motion selector is cleared only when a reduce block names the same selector. rule-cache key includes the new fields.

Acceptance criteria:

  • Handling scoped to covered selectors or global reset: reduced-motion.ts; tests 'a reduced-motion rule naming the same selector handles that motion', 'stylesheetMotionOf reports covered selectors and the global flag'.
  • FA6 + own infinite animation warns: test 'Font Awesome 6 CSS plus an infinite animation on the page's own element warns' (and marquee variant).
  • Global reset passes: tests 'a global reset in the page's own CSS / in a linked stylesheet still passes'.
  • Tests cover both: yes.

Gates: rules suite 12510 pass 0 fail; audit-engine suite 2365 pass 0 fail (one unidentified failure on the first full run, green on rerun; nothing in it touches this rule beyond the cache key); typecheck rules and audit-engine clean. rules has no lint/format scripts.
Docs: no user-facing docs change. Agent skill: no change needed.

@nc9
nc9 force-pushed the boat/reduced-motion-lib-2111 branch 2 times, most recently from 49f824b to b1db0fc Compare November 20, 2026 21:42
@nc9
nc9 force-pushed the boat/reduced-motion-lib-2111 branch from b1db0fc to 98af6e1 Compare November 21, 2026 02:05
@nc9
nc9 marked this pull request as ready for review November 21, 2026 04:09
@nc9
nc9 merged commit c6b7474 into main Nov 21, 2026
8 of 15 checks passed
@nc9
nc9 deleted the boat/reduced-motion-lib-2111 branch November 21, 2026 04:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a11y/reduced-motion: a library's own reduced-motion block (Font Awesome 6) should not mark the whole page as handled

1 participant