Skip to content
MotionSpec
Guide

prefers-reduced-motion: CSS, JavaScript and Chrome testing

prefers-reduced-motion is a CSS media feature that exposes a visitor’s preference for less animation. Use it to reduce nonessential movement while preserving content and controls. Test both preference states, changes during a visit, and JavaScript-driven motion; a CSS rule alone does not prove accessibility.

What is prefers-reduced-motion?

Modern operating systems expose a "reduce motion" setting. When someone turns it on — often because animation makes them physically unwell — the browser reports it to CSS through the prefers-reduced-motion media feature. It has two values: reduce (the person has asked for less motion) and no-preference (they have not). Your job is to design for both.

This matters because motion is not neutral. For people with vestibular disorders, large parallax scrolls, zooming transitions, and spinning elements can trigger genuine dizziness, nausea, and migraines. Reduced motion accessibility is not a nice-to-have polish item; for a real slice of your users it is the difference between a usable page and one they have to close.

The September 2026 study reports 196 entries, including 186 measured results. Its September CSV records 180 reduced-motion flags (96.8%), 121 loop-without-pause flags (65.1%) and two results marked clean. These are scanner classifications requiring contextual review, not a count of independently confirmed WCAG violations or proof that any app is fully accessible.

The prefers-reduced-motion CSS media query: syntax and values

There are two ways to write the guard. The first is the blanket opt-out: let motion run by default, then tone it down when reduce is requested.

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

This broad override shortens CSS animations; it does not stop JavaScript, video or canvas motion. Test final visual states, animation-event handlers and progress feedback before using it. For new components, start with usable static content and add nonessential motion only under no-preference:

/* Usable static default; no-preference is not explicit consent. */
.card { opacity: 1; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes slide-in {
    from { transform: translateY(0.5rem); }
    to { transform: translateY(0); }
  }
  .card { animation: slide-in 0.4s ease-out; }
}

With the opt-in pattern, "reduce" is the default state, so someone who wants less motion gets the calm version without your CSS having to undo anything. It is progressive enhancement applied to movement.

How do you check prefers-reduced-motion in JavaScript?

Read window.matchMedia with the prefers-reduced-motion: reduce query and inspect its matches property. A true result means the browser currently reports a reduced-motion preference, including a DevTools override. It does not prove that animations respect it. Listen for changes and test the resulting behavior separately.

JavaScript-driven motion — a WAAPI animation, a GSAP timeline, a scroll library — needs to check the preference itself. Use window.matchMedia, and listen for changes so the page responds if the user flips the setting without reloading: For the GSAP-specific pattern — including the cleanup that gsap.matchMedia() does for you — see GSAP and prefers-reduced-motion.

Framework helpers stop short in similar ways: what framer-motion's useReducedMotion does not cover, the reduced-motion gap in Next.js View Transitions, and why Tailwind's motion-safe: variant does not close WCAG 2.2.2.

const query = window.matchMedia('(prefers-reduced-motion: reduce)');

function applyMotionPreference() {
  if (query.matches) {
    // The user wants less motion: skip or shorten JS animations.
  } else {
    // Optional motion: still respect pause controls and other accessibility needs.
  }
}

applyMotionPreference();
query.addEventListener('change', applyMotionPreference);

The listener detects preference changes during a visit. Implement cancellation and a usable final state for existing animations; remove listeners when a component unmounts. The example is a lifecycle outline, not a complete animation controller.

How to test prefers-reduced-motion

Implementing the guard is half the work; the other half is confirming it fires. Four ways, from most manual to most automatic:

  1. Toggle the OS setting — the ground truth.
    • macOS: System Settings → Accessibility → Display → Reduce motion.
    • Windows: Settings → Accessibility → Visual effects → Animation effects off.
    • iOS: Settings → Accessibility → Motion → Reduce Motion. Android: Settings → Accessibility → Remove animations.
  2. Emulate it in DevTools — in Chrome/Edge, open the Command Menu (Cmd/Ctrl + Shift + P), run "Emulate CSS prefers-reduced-motion", and reload. Fast while iterating, but it emulates the CSS signal, not the OS.
  3. Assert it in code — read the preference the same way your app does:
    console.log(window.matchMedia('(prefers-reduced-motion: reduce)').matches);
    In an e2e test, launch the page with the preference forced on, then assert the animated element has no active animation. That turns "we honor reduced motion" into a test that fails loudly.
  4. Use a static scan for triage — the free prefers-reduced-motion checker inspects accessible linked CSS and style blocks for motion candidates. Review its coverage and suggested fixes, then test actual behavior in a browser. Runtime JavaScript, GSAP, video, canvas and flashing need separate checks. No signup is required. How this scan differs from Lighthouse, axe and other motion linters is laid out in the tool comparison.

How do you test reduced motion in Chrome?

To test reduced motion in Chrome, open DevTools and its Rendering panel, then set the prefers-reduced-motion emulation to reduce. Check the page’s interactions and content, then compare no-preference. This changes the test environment; it does not enable the operating system’s preference for everyday browsing.

  1. Open DevTools on the page you are testing. In its Command Menu, search for Show Rendering and open the Rendering panel.
  2. Find Emulate CSS media feature prefers-reduced-motion and select prefers-reduced-motion: reduce.
  3. In the Console, run window.matchMedia('(prefers-reduced-motion: reduce)').matches. Expect true; then scroll, navigate by keyboard and exercise interactive elements. Confirm that content remains visible and usable.
  4. Switch to no-preference, then back to reduce while the page is open. Test a fresh load too: startup behavior and live preference changes can differ.
  5. Choose No emulation to remove the override. Separately test the real operating-system preference; DevTools emulation alone does not establish end-to-end behavior.

Follow the Chrome DevTools media emulation reference and the matchMedia API reference. If the Console reports true but motion continues, inspect the animation implementation: the preference is a signal, not a browser-wide animation blocker. Check runtime libraries separately; see our GSAP reduced-motion guide.

Common mistakes

  • Leaving motion unguarded — animation with no prefers-reduced-motion block at all. A source search can locate missing media queries, but it cannot determine whether rendered movement is essential or controlled by another mechanism.
  • Nuking every animation — "reduce" means less motion, not a frozen page. Swap large movement for a gentle opacity fade rather than removing all feedback.
  • Ignoring essential motion — a progress indicator is not automatically exempt. Prefer static status feedback where it conveys the same information; assess whether motion itself is essential.
  • Only guarding CSS — if your JS/GSAP/scroll library animates without checking matchMedia, the CSS guard is irrelevant to that motion.

How it maps to WCAG

WCAG 2.3.3 Animation from Interactions (Level AAA) concerns disabling nonessential motion triggered by interaction. WCAG 2.2.2 Pause, Stop, Hide (Level A) has separate conditions: moving content that starts automatically, lasts more than five seconds and appears alongside other content needs a pause, stop or hide mechanism unless essential. Auto-updating content has its own requirements. Reduced-motion support does not replace checking these conditions and controls.

What should an agency record after testing reduced motion?

Record the page URL, release, browser, device, motion preference and interaction steps. Note which animations stopped, whether content remained usable and which findings still need review. Attach before-and-after evidence and assign an owner for rechecks after template, plugin or content changes.

Use the agency motion handoff checklist to organize this review, then inspect a sample dated report. For recurring checks across selected client domains, see MotionSpec for agencies.

FAQ

What does prefers-reduced-motion do?

It is a CSS media feature that reports whether someone has turned on their device's "reduce motion" setting. It has two values — reduce and no-preference — so your CSS and JavaScript can serve a calmer version to people who ask for less animation.

How do I test prefers-reduced-motion?

Test the operating-system preference and browser emulation, then exercise real interactions with reduced motion enabled. Check content visibility, final states and changes while the page is open. A static CSS scan can flag review candidates; it cannot establish how every runtime animation behaves.

Does reduced motion mean removing all animation?

Reduced motion calls for an appropriate alternative, such as static content or a subtle transition where suitable. A progress indicator is not automatically exempt: assess whether the movement itself is essential and whether static status text conveys the same information. Test the alternative in context.

Does the CSS guard cover JavaScript animation?

No. A @media (prefers-reduced-motion) block only governs CSS. WAAPI, GSAP, and scroll libraries have to check window.matchMedia themselves, or they will animate straight through the user's preference.

Check prefers-reduced-motion on your own site.

Paste any URL into the free motion check — a static CSS scan with motion candidates and suggested fixes for developer review. No signup required.

Check a page for free

One page tells you. A dated write‑up is what you hand to a client or a boss: the $9 Motion Report cites every candidate to WCAG 2.2.2 / 2.3.3 and provides study context alongside the scan’s stated coverage — read a real one first. Fourteen‑day refund, no questions asked.

Generating web UI at scale? See the Design Partner Program.

Agency or studio shipping client sites? Keep a dated Motion Report for each client URL — $9 once, no subscription — and re‑run the free check after every release. How agencies use MotionSpec.