Skip to content
Tutorials Center
My learning

Topics

Lesson 24 of 38 ยท Colour, Contrast and Media

Motion, Animation and Flashing

Avoid seizure triggers and motion sickness: the three-flash rule, prefers-reduced-motion, pause controls for carousels, and safe animation patterns.

Motion can delight, guide attention and explain change. It can also trigger seizures, nausea, dizziness and migraines, or simply make a page impossible to read for people with attention disorders. Accessible motion means three things: nothing that flashes dangerously, nothing that moves forever without a stop control, and respect for the user's "reduce motion" setting.

Flashing: the safety rule

WCAG 2.3.1 Three Flashes or Below Threshold (level A): nothing flashes more than three times in any one second, unless the flash is small and low contrast. This is about photosensitive epilepsy, which can be triggered by large, bright, rapid flashes, especially red ones and alternating patterns.

This is a hard safety requirement. If you are unsure, do not flash. A general-flash threshold: the flashing area is less than roughly 21,824 square pixels (a 341 by 256 box) and not saturated red.

2.3.2 (AAA) goes further: no flashing more than three times per second at all.

Moving, blinking, scrolling content

2.2.2 Pause, Stop, Hide (level A): if content moves, blinks or scrolls, starts automatically and lasts more than 5 seconds, and is shown alongside other content, users need a way to pause, stop or hide it. Auto-updating content (news tickers, live scores) must also be pausable.

Typical offenders: carousels, background videos, animated GIFs, marquee tickers. A visible pause button solves it.

Carousel with a pause button

Also pause the rotation while the user hovers over or focuses inside the carousel, and never move focus automatically.

Motion from user actions

2.3.3 Animation from Interactions (AAA): motion triggered by interaction (parallax scrolling, zoom-on-scroll, slide-in panels) can be turned off. Parallax, large sliding transitions and spinning elements can cause vestibular symptoms: dizziness, nausea and disorientation.

You do not have to reach AAA to be kind here. The browser and operating system have a setting for it, and you can read it with CSS.

prefers-reduced-motion

Users who enable "Reduce motion" (macOS, iOS, Windows, Android) signal that large movement hurts. Your CSS can respond:

CSS
.hero { animation: slide-in 600ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  .hero { animation: none; }
  * { scroll-behavior: auto !important; }
}

Two strategies:

  • Motion-first: animate by default, strip it inside prefers-reduced-motion: reduce.
  • Reduced-first: static by default, add motion in @media (prefers-reduced-motion: no-preference). This is safer because unsupported browsers see no motion.

"Reduce" does not always mean "remove". Subtle fades and color changes are usually fine; avoid large translations, zooms, spins and parallax.

The demo reads the setting and applies the right behavior. Turn on "reduce motion" in your OS to see the difference.

Respecting reduced motion

In JavaScript animation (canvas, GSAP, Lottie) check matchMedia('(prefers-reduced-motion: reduce)') before starting, and listen for changes.

Safer animation patterns

  • Prefer opacity and color transitions to big movements.
  • Keep durations short (150 to 300 ms for UI feedback).
  • Avoid infinite loops; if you must, limit them or add a pause control.
  • Do not animate large areas of the viewport or the background of text.
  • Do not use motion as the only signal; add text or a state change.
  • Provide a static alternative to animated GIFs: the <video> element with controls and no autoplay is easier to pause than a GIF.

Other time limits

Related but separate: 2.2.1 Timing Adjustable (A) says that if a session times out, users can turn off, adjust or extend the limit (with a warning at least 20 seconds before). Do not make people race a clock for a form.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the WCAG flash limit at level A?

    2.3.1 sets three flashes per second as the threshold; above it, large bright flashes can trigger seizures.
  2. 2. An auto-rotating carousel runs for 20 seconds. What do you need?

    2.2.2 requires a pause/stop/hide mechanism for moving content that starts automatically and lasts over 5 seconds.
  3. 3. Which media query reads the user's reduce-motion setting?

    prefers-reduced-motion exposes the operating system preference to CSS and to matchMedia in JavaScript.
  4. 4. Why is a 'reduced-first' strategy (motion only inside no-preference) considered safer?

    If the query is unsupported or fails, the default state is static, so nobody gets unwanted motion.

Summary

  • Never flash more than three times per second; avoid large bright flashing.
  • Give pause/stop/hide controls to automatic motion lasting over 5 seconds.
  • Honor prefers-reduced-motion in CSS and JavaScript.
  • Prefer subtle effects (opacity, color) over parallax, zoom and spin.

Next: Accessible Form Labels and Instructions