Most accessibility snippets tell you to slap animation: none !important inside @media (prefers-reduced-motion: reduce) and call it a day. On flashy creative effects — neon flicker, glitch slices, typewriter reveals, and JS character scrambles — blindly killing the animation often breaks the UI: a typewriter freezes at 0 width, a neon sign stays stuck half-dimmed, or an overlay stays invisible at opacity: 0.
Good reduced-motion design does not delete your aesthetic. It keeps the color, glow, and layout, and replaces rapid motion or flashing with a calm, finished static state.
The quick answer
Design the static, readable state as your default, and only turn on motion inside @media (prefers-reduced-motion: no-preference) — or explicitly set the finished visual state inside reduce:
/* Default: calm, fully lit, readable */
.neon {
color: #fff8c2;
text-shadow: 0 0 6px #ffe600, 0 0 24px #ff9e00;
}
/* Motion only for people who have not asked to reduce it */
@media (prefers-reduced-motion: no-preference) {
.neon {
animation: flicker 4s steps(1) infinite;
}
}
Compare a broken animation: none fallback against an intentional static fallback:
Static fallback recipes for every effect type
Different effects fail in different ways when frozen at 0%. Use these exact fallback rules so nothing ever looks half-loaded:
| Effect | What breaks with naive animation: none |
Proper reduced-motion fallback |
|---|---|---|
| Neon flicker | Stuck in the dark "off" frame | Set steady full glow (color + text-shadow), no flicker keyframes |
| Glitch text / RGB split | Pseudo-elements stuck mid-offset or doubled | animation: none; transform: none; on ::before/::after (or subtle static 1 px fringe) |
| Typewriter | Text hidden at width: 0 or 0ch |
width: auto; animation: none; + solid non-blinking cursor |
| Rotating gradient border | Looks fine, just stops spinning | animation: none; — static gradient ring stays crisp |
| JS Scramble / decrypt | Random gibberish never resolves | Check matchMedia in JS and render el.dataset.text immediately |
Here is how the static fallback looks for a glitch heading — the word stays sharp and legible, with zero flashing or horizontal tearing:
Every effect on Glitch Lab ships with a built-in prefers-reduced-motion fallback (and an optional "Play anyway" control in the playground):
Handling JavaScript animations (scramble, canvas, timers)
CSS media queries cannot stop a requestAnimationFrame loop or a setTimeout flicker. In vanilla JavaScript, check window.matchMedia once before starting the effect — and listen for live OS changes if the page stays open:
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)");
function startScramble(el) {
if (reducedMotion.matches) {
el.textContent = el.dataset.text; // show final word immediately
return;
}
runScrambleLoop(el);
}
This is the exact pattern used in Scramble Text so users with reduced motion enabled never see flickering random glyphs:
Why no-preference is cleaner than reduce
Writing animations inside @media (prefers-reduced-motion: no-preference) flips the default to safe-first:
- You never accidentally forget to override one of four pseudo-element animations.
- If a browser or embed strips media queries, the element still renders in its finished, readable state.
- Short, non-vestibular feedback (like a gentle 150 ms color change on
:hover) can stay outside the media query —prefers-reduced-motionmeans reduced motion, not zero visual feedback.
How to test reduced motion in 5 seconds
You do not have to dig into your operating system settings every time:
- Chrome / Edge DevTools: press
Ctrl+Shift+P(orCmd+Shift+Pon macOS) → typeEmulate CSS prefers-reduced-motion: reduce→ Enter. - Firefox DevTools: open
about:configor the Inspector's Accessibility / Rules emulation toggle forprefers-reduced-motion. - Safari: System Settings → Accessibility → Display → Reduce motion.
FAQ
Does prefers-reduced-motion mean I have to remove all transitions?
No. Opacity fades, subtle color shifts, and button hover highlights are completely fine. What triggers discomfort is rapid flashing (neon flicker), sudden horizontal tearing (glitch slices), parallax, zooming, and looping movement.
How do I stop a CSS typewriter animation from disappearing under reduced motion?
Reset width: auto (or max-width: none), set animation: none, and keep the cursor solid (opacity: 1) inside @media (prefers-reduced-motion: reduce) so the full text is immediately readable.
What about JavaScript animations like GSAP or requestAnimationFrame?
Read window.matchMedia("(prefers-reduced-motion: reduce)").matches before starting the animation loop. When it is true, skip the animation and render the final state immediately.