Accessibility CSS Beginner

Turn Off Animations for People Who Prefer Reduced Motion

Stop animations, transitions and smooth scrolling for visitors who have turned on "Reduce motion" on their device.

Tested on WordPress 7.1 No plugin needed Updated
style.css 10 lines
@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;
	}
}

Where to add this

Recommended Additional CSS Appearance → Customize → Additional CSS, or your page builder's global CSS.
Child theme At the end of your child theme's style.css file.
A code snippets plugin As a CSS snippet set to load on the front end.

Motion like sliding panels, parallax and bouncing buttons can make some people dizzy or sick. Phones and computers have a “Reduce motion” setting, and this CSS makes your site respect it.

How it works

The prefers-reduced-motion: reduce media query only matches when the visitor has turned the setting on. Inside it, every element’s animations and transitions are made almost instant, and smooth scrolling is switched off.

Durations are set to 0.01 ms rather than 0, so JavaScript waiting for an “animation finished” event still gets it.

Things to watch

  • Everyone else sees your animations as normal.
  • Autoplaying videos and carousels driven by JavaScript need their own checks. See “Stop Videos Autoplaying”.

How to test it

Turn on Reduce motion (macOS: Accessibility → Display; Windows: Accessibility → Visual effects → Animation effects off; iPhone: Accessibility → Motion), then reload your site. Animations should stop.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only