How can CSS honor a user’s reduced-motion preference for transitions?
Quick answer
Put the ordinary transition in your default CSS, then use @media (prefers-reduced-motion: reduce) to remove or reduce motion that is not needed to understand a change. The reduce preference indicates that the user wants nonessential motion minimized. Keep the resulting state clear through a visible color, border, icon, or text change; reducing motion should not hide whether an interaction took effect. [S1] [S2]
The question, the details, the next step.
A practical checklist
List transitions and animations, and identify which movement is nonessential.
Add a
prefers-reduced-motion: reducerule to remove or simplify nonessential movement.Keep important state changes visible with an immediate color, border, icon, or text change.
Check the same interactions with reduced motion off and on.
Inspect hover, focus, and active or selected states, not just the initial view.
A few more useful answers
Does `prefers-reduced-motion: reduce` mean every transition must be removed?
How can I show a change if its transition is removed?
Use a visible result that does not depend on movement, such as a changed color, border, icon, or label. The interface should still communicate the resulting state. [S2]
Should the reduced-motion rule change the state styling too?
It can. For example, remove a movement effect while keeping an immediate color or border change so the state remains apparent.
Sources
References used for this guide.
- [S1] prefers-reduced-motion CSS media feature — MDN developer.mozilla.org · Checked
- [S2] Using media queries for accessibility — MDN developer.mozilla.org · Checked
