Repository navigation
feat(rules): add a11y/reduced-motion rule #711 - #2050
Merged
Merged
Conversation
nc9
force-pushed
the
boat/reduced-motion-711
branch
7 times, most recently
from
November 17, 2026 17:55
e00ec80 to
a9e7ba8
Compare
4 tasks
nc9
force-pushed
the
boat/reduced-motion-711
branch
3 times, most recently
from
November 17, 2026 22:01
ab98190 to
7b42c98
Compare
nc9
added a commit
that referenced
this pull request
Nov 17, 2026
…for self-starting motion; pin 2.3.3 in the a11y WCAG test #2050 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
marked this pull request as ready for review
November 18, 2026 00:26
Signed-off-by: Nik Cubrilovic <[email protected]>
…for a11y/reduced-motion #711 Signed-off-by: Nik Cubrilovic <[email protected]>
…n findings #711 Signed-off-by: Nik Cubrilovic <[email protected]>
…on findings #711 Signed-off-by: Nik Cubrilovic <[email protected]>
…ealth score 57, changelog #711 Signed-off-by: Nik Cubrilovic <[email protected]>
… link names and body text #711 An animation in a stylesheet counts only when its selector matches an element on the page, library names are read only from script, stylesheet and preload URL paths, a video needs autoplay and loop, an empty data-autoplay is off, -webkit-animation is detected, and handling needs a real reduced-motion @media rule or a matchMedia script. A page with an unread linked stylesheet gets a skipped reduced-motion-unverified check instead of the clean pass. The inline CSS is parsed once. Signed-off-by: Nik Cubrilovic <[email protected]>
…l selectors in a11y/reduced-motion #711 Signed-off-by: Nik Cubrilovic <[email protected]>
…ced-motion pseudo stripping pub#2050 Signed-off-by: Nik Cubrilovic <[email protected]>
…2050 Signed-off-by: Nik Cubrilovic <[email protected]>
…for self-starting motion; pin 2.3.3 in the a11y WCAG test #2050 Signed-off-by: Nik Cubrilovic <[email protected]>
Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
boat/reduced-motion-711
branch
from
November 18, 2026 00:27
24842ee to
679c62f
Compare
nc9
added a commit
that referenced
this pull request
Nov 18, 2026
…for self-starting motion; pin 2.3.3 in the a11y WCAG test #2050 Signed-off-by: Nik Cubrilovic <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
a11y/reduced-motion: motion on a page with noprefers-reduced-motionhandling. Closes #711.How it works
animationor-webkit-animation) in an inlinestyleattribute, or in an inline<style>or read stylesheet rule whose selector matches an element on the page;scroll-behavior: smoothin a rule whose selector matches the page (html,:root,bodyand*always match); a<video>with bothautoplayandloop;<marquee>; an auto-advancing carousel (data-autoplaywith a value other than empty,false,0oroff, or a library autoplay option); AOS, GSAP ScrollTrigger, Lottie, animate.css/WOW.js, parallax libs and Locomotive/Lenis, with library names matched only in the URL path of a script, stylesheet, preload or modulepreload link (never canonical, hreflang or other links).@media (prefers-reduced-motion ...)rule (inline or read stylesheet; comments do not count), a script that callsmatchMediawith the query (inline or read), or a stylesheet whosemediaattribute carries the query (its motion is then gated). The words in body text do not count.reduced-motion-unverified, never the cleanreduced-motionpass (which clears all 11 problem checks). Exception: a stylesheet from a known font-only host (FONT_ONLY_STYLESHEET_HOSTS: fonts.googleapis.com, fonts.bunny.net, use.typekit.net, p.typekit.net, api.fontshare.com) holds only@font-facerules and is not counted as unread. use.fontawesome.com is not on the list, because its CSS has animations.reduced-motion-<source>), so the report groups it into one finding listing the pages.site.stylesheetMotionsummary (read,mentionsReducedMotion,hasInfiniteAnimation,hasSmoothScroll,infiniteAnimationSelectorsandsmoothScrollSelectors, each capped at 100 selectors of 200 chars) computed in the adapter from the existing bounded stylesheet fetch. Bodies are never kept.parseRules/parseDeclarationsfromcontent/hidden-text.ts, capped at 512 KB and 5000 rules per file; inline CSS is parsed once per page; selector matching is capped at 200querySelectorcalls per page.Score and cache effect
reduced-motionpass the day this ships; a page with no detected motion but an unread stylesheet gets a skippedreduced-motion-unverifiedcheck instead. Accessibility rule count 62 to 63.Acceptance criteria (evidence in
packages/rules/tests/reduced-motion-711.test.ts)reduced-motion-unverifiedcheck and no pass ("an unread stylesheet with no motion gives the unverified skipped check, no pass", "an unread stylesheet plus inline handling still gives no pass")docs/rules/a11y/reduced-motion.mdxcites WCAG 2.3.3 and 2.2.2Review fix round (failing first on e00ec80: 12 fail / 12 pass; after: 24 pass / 0 fail): unused
.fa-spinrule not a finding, canonical/team/lottie-smithnot a finding, play-once autoplay video and empty orfalsedata-autoplayoff,-webkit-animationdetected, body text and CSS comments not handling.Fix round 2 (failing first on a9e7ba8: 4 fail / 27 pass; after: 31 pass / 0 fail): a page with only a Google Fonts sheet and no motion passes; the same page with a used looping animation and no handling warns (not info); a cdn.shopify.com sheet stays
reduced-motion-unverified; use.fontawesome.com stays unverified; an unused.scroll-smooth{scroll-behavior:smooth}is not a finding;html,:root,bodyand*smooth scrolling warn; a used.scroll-smoothwarns (inline and in a read sheet).Gates (head a6bd176, rebased onto main with sign-off)
bun run scripts/test-suites.ts --run rules(ci.yml step): 11297 pass, 25 todo, 0 failbun run scripts/test-suites.ts --run audit-engine(ci.yml step): 2241 pass, 3 skip, 0 failbun run test:engine(goldens): 269 pass, 1 skip, 0 fail (no regeneration needed)bun run typecheckin packages/rules (src + tests) and packages/audit-engine: passbun run format:checkandbun run lint: passmake validatein docs/: passThe squirrelscan agent skill does not need a change.
Basis for the font-host list: a local sample of 203 stored homepages from recent CLI audits, where 26.6% link a stylesheet from another host and
fonts.googleapis.comis on 17.2% of all pages (about two thirds of the third-party cases; next were cdn.shopify.com 3.0%, cdnjs 1.5%, use.typekit.net 1.0%, fonts.bunny.net and api.fontshare.com 0.5% each).Caveats: a small sample, homepages only, and only the sites we happened to audit, so the shares are indicative, not measured across the web.