squirrelscan
GitHub

prefers-reduced-motion: motion that ignores the reduce motion setting

Parallax, looping animation and autoplay can make people with vestibular disorders ill. squirrel flags motion on pages with no prefers-reduced-motion handling.

What reduced motion is

Every major operating system has a reduce motion setting, and browsers expose it to pages as the media query @media (prefers-reduced-motion: reduce). Parallax heroes, scroll-triggered fade-ins, auto-advancing carousels and looping animation can make people with vestibular disorders dizzy or nauseous. A page that animates without ever reading that query ignores the setting completely.

This rule declares one WCAG criterion: 2.3.3 Animation from Interactions (Level AAA), which asks that motion animation triggered by interaction can be disabled, and for which technique C39 uses prefers-reduced-motion. It does not declare 2.2.2 Pause, Stop, Hide (Level A), which asks that moving content that starts automatically and lasts more than five seconds can be paused: the rule never looks for a pause control, which may exist. So it reports missing reduced-motion handling, not a WCAG failure. 2.3.3 covers motion that interaction starts, such as scroll-triggered effects, parallax and smooth scrolling; looping animation, autoplay video, marquees and auto-advancing carousels start on their own, so for those findings 2.3.3 is the nearest criterion, not an exact match.

What squirrel checks

The rule reads the page markup, inline <style> blocks, inline scripts, same-site scripts the audit fetched, and a summary of each same-site stylesheet the audit fetched. It runs in the CLI and in HTTP-only audits.

Third-party stylesheets are not read, so a page that links one (a theme on a CDN, for example) gets a partial result, except sheets from font-only hosts (fonts.googleapis.com, fonts.bunny.net, use.typekit.net, p.typekit.net, api.fontshare.com), which hold only @font-face rules and are ignored.

A page has a motion signal when it has any of:

  • a looping CSS animation (animation, -webkit-animation or animation-iteration-count set to infinite) in an inline style attribute, or in an inline <style> or read stylesheet rule whose selector matches an element on the page (so an unused .fa-spin rule from an icon font does not count)
  • scroll-behavior: smooth in a rule whose selector matches an element on the page; html, :root, body and * always match, so an unused .scroll-smooth utility class does not count
  • a <video> with both autoplay and loop
  • <marquee>
  • a motion library: AOS (data-aos), GSAP ScrollTrigger, Lottie players, animate.css or WOW.js, parallax (data-parallax, Rellax, Jarallax), Locomotive Scroll or Lenis. Library names are matched only in the path of a <script src> or a stylesheet, preload or modulepreload link, never in canonical, alternate or icon links, a hostname or a query string
  • a carousel set to auto-advance (data-autoplay with a value other than empty, false, 0 or off, or Swiper, Slick, Splide or Flickity autoplay options)

Handling counts only when the page has one of:

  • an @media rule whose condition contains prefers-reduced-motion, in an inline <style> or a read stylesheet (a comment, body text or string that mentions it does not count)

  • an inline or read script that calls matchMedia and contains prefers-reduced-motion (window.matchMedia("(prefers-reduced-motion: reduce)"), or GSAP’s gsap.matchMedia())

  • a <link rel="stylesheet"> or <style> whose media attribute contains prefers-reduced-motion; the motion in that sheet is gated, so it is not counted either

  • A warning means the page has a motion signal and none of the CSS and scripts the audit read handles reduced motion, and everything the page references was read.

  • An info result means the same, but a referenced stylesheet (including a third-party one) or a same-site script was not read, so the handling may live there. The message says the check was partial.

  • A skipped reduced-motion-unverified check means a linked stylesheet was not read (a fetch error, the 20-stylesheet limit, or a file over 1 MB) where the rule would otherwise have passed. The rule never passes when it could not read every stylesheet the page links.

  • Each motion source is one finding across the site, listing the pages it appears on, because motion usually comes from a shared template.

Not reported: hover and focus transition rules, a single non-looping entrance animation, animated GIFs (see animated-content), and motion that only runs inside @media (prefers-reduced-motion: no-preference).

Stylesheet reading is bounded: a file over 1 MB is not read and counts as partial, and parsing stops at a fixed number of rules per file.

How to fix it

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

In script, check the query before starting scroll animation or autoplay:

const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
if (!reduce) AOS.init();

Some libraries expose an option for this (AOS has disable: "mobile" or a function), so check the library docs before writing your own.

Rule IDa11y/reduced-motion
CategoryAccessibility
ScopePer-page
Severitywarning
Weight3/10

Enable / disable

Disable this rule

[rules]
disable = ["a11y/reduced-motion"]

Disable all Accessibility rules

[rules]
disable = ["a11y/*"]

Check names by outcome

Each check name this rule can emit, by what it means to a tool comparing two audits. A problem check is a finding. A clean check says the rule ran over what it covers and found nothing; it clears the problem checks listed beside it, so a finding is fixed when the rule ran over the same scope and a clean check took its place. A not checked check says the rule did not evaluate, and never clears a finding.

Check nameOutcomeClears
reduced-motion-aosProblem
reduced-motion-gsap-scrolltriggerProblem
reduced-motion-lottieProblem
reduced-motion-animate-wowProblem
reduced-motion-parallaxProblem
reduced-motion-smooth-scroll-libProblem
reduced-motion-carousel-autoplayProblem
reduced-motion-marqueeProblem
reduced-motion-autoplay-videoProblem
reduced-motion-css-infinite-animationProblem
reduced-motion-css-smooth-scrollProblem
reduced-motion-unverifiedNot checked
reduced-motionCleanreduced-motion-aos, reduced-motion-gsap-scrolltrigger, reduced-motion-lottie, reduced-motion-animate-wow, reduced-motion-parallax, reduced-motion-smooth-scroll-lib, reduced-motion-carousel-autoplay, reduced-motion-marquee, reduced-motion-autoplay-video, reduced-motion-css-infinite-animation, reduced-motion-css-smooth-scroll

WCAG success criteria

The WCAG success criteria this rule’s findings map to. These automated checks cover part of WCAG; passing them does not mean a site conforms. Run squirrel audit --wcag-level AA to keep only the accessibility rules mapped to a criterion at Level A or AA.

CriterionLevelIntroduced in
2.3.3 Animation from InteractionsAAAWCAG 2.1

Type to search…

↑↓ navigate↵ openesc close