Reduced Motion Accessibility
Some users request reduced motion through their operating-system accessibility preferences. CSS can respond using prefers-reduced-motion: reduce.
Decorative motion should generally be reduced or removed for these users, while essential state transitions should remain understandable.
Reduced Motion Preference
Respect Reduced Motion
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}💡 The media query detects a user preference for reduced motion.
Key Takeaways
- Respect user motion preferences.
- Do not use motion as the only way to communicate important information.
Knowledge Check
Which media feature detects a user's reduced-motion preference?