This rule raises an issue when a spatial animation, movement transition, or smooth scrolling does not respect reduced-motion preferences.

Why is this an issue?

Spatial motion can cause dizziness or nausea. Enable it only when prefers-reduced-motion is no-preference.

The rule reports:

Motion in @media (prefers-reduced-motion: no-preference), print is also reported: the print branch does not require no-preference.

CSS stylesheets, HTML/Vue style blocks, and literal SCSS, Sass, and Less declarations are checked.

Code examples

Noncompliant code example

.panel {
  transform: translateX(0);
  animation: slide-in 400ms ease; /* Noncompliant */
}

@keyframes slide-in {
  from { transform: translateX(2rem); }
  to { transform: translateX(0); }
}

Compliant solution

.panel {
  transform: translateX(0);
}

@media (prefers-reduced-motion: no-preference) {
  .panel {
    animation: slide-in 400ms ease;
  }
}

@keyframes slide-in {
  from { transform: translateX(2rem); }
  to { transform: translateX(0); }
}

Keep the static final state outside the query. Check that code listening for animationend still works when the animation does not run.

Alternatively, use a later rule with the same selector to disable the animation for users who request reduced motion:

.panel {
  transform: translateX(0);
  animation: slide-in 400ms ease;
}

@keyframes slide-in {
  from { transform: translateX(2rem); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .panel {
    animation: none;
  }
}

Noncompliant code example

Keep the hover transform outside the media query and guard the transition so all users receive the intended final state.

.panel {
  transition: transform 400ms; /* Noncompliant */
}

.panel:hover {
  transform: translateX(1rem);
}

Compliant solution

.panel:hover {
  transform: translateX(1rem);
}

@media (prefers-reduced-motion: no-preference) {
  .panel {
    transition: transform 400ms;
  }
}

Noncompliant code example

Keep instant scrolling as the default and enable smooth scrolling only when the user has not requested reduced motion.

html {
  scroll-behavior: smooth; /* Noncompliant */
}

Compliant solution

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

Exceptions

The rule does not report:

The ignoreSelectors parameter accepts comma-separated selector strings or /regular-expression/ patterns. It is empty by default. Use it only after verifying a reduced-motion safeguard in another file or application code, or that the motion is essential.

Known limitations

Animations with only a from or to keyframe can be missed, even if the element declares a different starting value.

The rule can still report a stationary effect when an !important declaration prevents its movement. It can also report equivalent spatial values written differently, such as rotate(90deg) and rotate(.25turn), or translateX(1in) and translateX(96px).

Resources

Documentation

Standards