How to Support Prefers Reduced Motion in CSS and JavaScript
A parallax hero, a carousel that slides every four seconds and a page full of fade in effects can make some visitors feel dizzy or nauseous within a minute.

A parallax hero, a carousel that slides every four seconds and a page full of fade in effects can make some visitors feel dizzy or nauseous within a minute. The prefers reduced motion setting exists so people can tell your site to calm down, yet most sites still ignore it or handle it with one blunt rule that breaks things.
I lead front-end work on product sites where motion is part of the brand, so I have had to balance designers who love animation with users who need less of it. This guide covers how the setting works, a CSS approach that does not wreck your layout, the JavaScript side, and a few cases where removing all motion is the wrong call.
What prefers reduced motion actually tells you
Every major operating system has a setting for reducing motion. On macOS and iOS it sits under Accessibility, then Motion or Display. Windows calls it "Animation effects" in its accessibility settings. Android has "Remove animations." When a user turns one on, the browser exposes it through the prefers-reduced-motion media feature with the value "reduce."
The people who switch this on are not a tiny group. It includes users with vestibular disorders, migraine sufferers, people with some attention conditions, and plenty of users who simply find constant animation tiring. Vestibular problems alone affect a meaningful share of adults at some point in their lives, and symptoms can be triggered by large movements across the screen.
The key word is "reduce," not "remove." The user is asking for less motion, especially the large, unexpected kind. They are not asking for a site that feels broken.
Handling prefers reduced motion in CSS
The blunt global rule and its problems
A popular snippet sets every animation and transition duration to 0.01ms inside a reduced motion media query, applied to every element with the universal selector. It is quick, and it is better than nothing. But it has side effects:
- Components that rely on an animationend or transitionend event can stall or fire in the wrong order.
- Loading spinners freeze in one position, which looks like the page has hung.
- Helpful motion, such as a subtle focus ring transition, disappears along with the harmful kind.
A more targeted approach
I prefer writing motion as an enhancement. Put the safe, static styles in your base CSS, then add animation only inside a media query for no-preference. That way, users who prefer reduced motion get the static version by default, and you never have to undo anything.
In practice, it looks like this: the card component has its final position and opacity in the normal rule. Inside a block for prefers-reduced-motion with the value no-preference, you add the keyframe animation that slides it in from 40 pixels below. Browsers that do not support the media feature at all simply get the static version, which is a safe default.
For things that should still change but not move, swap the type of motion rather than deleting it. Replace a slide with a short opacity fade of around 150 to 200 milliseconds. A cross fade does not create the sense of movement that causes vestibular symptoms, so it is usually fine.
The JavaScript side
CSS cannot catch everything. Scroll driven effects, carousels with autoplay, canvas animations and smooth scroll libraries are often controlled from JavaScript. Use window.matchMedia with the reduced motion query to check the setting, and read its matches property.
Three rules I follow on every project:
- Listen for changes. Add a change listener to the media query object. Users can switch the setting while your page is open, and the page should follow without a reload.
- Stop autoplay. If reduced motion is on, carousels and background videos should start paused with a clear play button.
- Make smooth scrolling instant. Pass the auto behaviour instead of smooth to scrollIntoView and scrollTo. A page that glides 3000 pixels after an anchor click is one of the worst triggers.
Whatever you do with scrolling, make sure focus still lands where it should. Instant jumps that move the viewport but leave focus behind are a classic problem, and our article on the keyboard navigation accessibility test most sites fail shows how to check that quickly.
Not all motion should go
A common recommendation is to remove every animation whenever the setting is on. I think that goes too far, and it can make an interface harder to use.
Some motion carries meaning. A small progress bar filling up tells you an upload is working. A short highlight on a newly added item shows where it landed in a list. A spinner tells you the page has not frozen. Strip those out and users lose feedback they rely on.
My rule of thumb splits motion into two groups. Decorative and large scale motion goes: parallax, zooming hero images, elements flying in from off screen, background video, autoplay carousels. Small, functional motion stays but gets simpler: progress indicators, spinners, short opacity changes and state transitions under about 200 milliseconds that move nothing more than a few pixels.
The guidance in WCAG backs this up. It focuses on motion triggered by interaction that is not essential, rather than every visual change.
How to test your reduced motion styles
You do not need to change your system settings each time. In Chromium DevTools, open the Rendering panel and set "Emulate CSS media feature prefers-reduced-motion" to reduce. Firefox lets you set a preference in about:config, and Safari follows the macOS setting.
Then walk through the page and check:
- Nothing larger than a small icon moves across the screen.
- Carousels and videos are paused, with visible controls.
- Anchor links and back to top buttons jump instantly.
- Loading states still show something is happening.
Automated tools rarely catch any of this, which is a good example of why automated accessibility scanners miss most real problems. A two minute manual pass is worth more here than any score.
For more practical guides like this, browse the accessibility section.
Frequently asked questions
What does prefers-reduced-motion do?
It is a CSS media feature that tells the page whether the user has asked their operating system to reduce motion. It does nothing on its own. Developers have to read it and adjust their animations, transitions and scrolling behaviour.
Should I remove all animations for reduced motion users?
No. Remove large and decorative motion, and keep small functional cues such as progress bars and spinners in a simpler form. Swapping slides for short fades is often the best middle ground.
Is prefers reduced motion required by WCAG?
WCAG does not name the media feature, but criteria on animation from interactions and on pausing moving content cover the same problems. Supporting the setting is one of the easiest ways to meet those criteria. It also helps users who would never file a complaint.
More in Accessibility
Accessibility
Accessible Loading States for Slow API Responses
A checkout button on a project I helped with took a median of 900 milliseconds to come back and a p95 of 4.2 seconds, which is...
Accessibility
How to Use the DevTools Accessibility Tree to Debug Names
A ticket landed on my desk years ago that read, in full, "Screen reader says button button on checkout." The developer who...
Accessibility
How to Build Accessible Data Tables for Screen Readers
A sighted user glances at a pricing table and instantly knows that "$29" belongs to the Pro plan and the "Monthly" row.