Stop animations, transitions and smooth scrolling for visitors who have turned on "Reduce motion" on their device.
@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;
}
}
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.
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.
Turn on Reduce motion (macOS: Accessibility → Display; Windows: Accessibility → Visual effects → Animation effects off; iPhone: Accessibility → Motion), then reload your site. Animations should stop.