Ask any question about CSS here... and get an instant response.
How can I detect user preferences for reduced motion in my CSS animations to ensure accessibility? Pending Review
Asked on Dec 22, 2025
Answer
To detect user preferences for reduced motion and ensure accessibility in your CSS animations, you can use the "prefers-reduced-motion" media feature. This allows you to adjust or disable animations based on the user's system settings.
<!-- BEGIN COPY / PASTE -->
@media (prefers-reduced-motion: reduce) {
.animated-element {
animation: none;
}
}
<!-- END COPY / PASTE -->Additional Comment:
- The "prefers-reduced-motion" media query checks if the user has requested reduced motion in their operating system settings.
- When this preference is detected, you can disable or simplify animations to accommodate the user's needs.
- This approach enhances accessibility by respecting user preferences and providing a more comfortable experience for those sensitive to motion.
- Always test your site with this setting to ensure that the user experience remains functional and clear without animations.
Recommended Links:
