This rule raises an issue when a spatial animation, movement transition, or smooth scrolling does not respect reduced-motion preferences.
Spatial motion can cause dizziness or nausea. Enable it only when prefers-reduced-motion is no-preference.
The rule reports:
:hover or
:focus.scroll-behavior: smooth).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.
.panel {
transform: translateX(0);
animation: slide-in 400ms ease; /* Noncompliant */
}
@keyframes slide-in {
from { transform: translateX(2rem); }
to { transform: translateX(0); }
}
.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;
}
}
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);
}
.panel:hover {
transform: translateX(1rem);
}
@media (prefers-reduced-motion: no-preference) {
.panel {
transition: transform 400ms;
}
}
Keep instant scrolling as the default and enable smooth scrolling only when the user has not requested reduced motion.
html {
scroll-behavior: smooth; /* Noncompliant */
}
@media (prefers-reduced-motion: no-preference) {
html {
scroll-behavior: smooth;
}
}
The rule does not report:
none.transition: all.calc().animation: none example above.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.
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).