-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Support for prefers-reduced-motion #16367
Copy link
Copy link
Open
Labels
accessibilitya11ya11yscope: all componentsWidespread work has an impact on almost all components.Widespread work has an impact on almost all components.type: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.
Milestone
Metadata
Metadata
Assignees
Labels
accessibilitya11ya11yscope: all componentsWidespread work has an impact on almost all components.Widespread work has an impact on almost all components.type: new featureExpand the scope of the product to solve a new problem.Expand the scope of the product to solve a new problem.
Expected Behavior 🤔
The transition components Collapse, Fade, Grow, Slide, and Zoom (and other MUI components with animations) should have reduced motion in their animations, by either disabling the animations altogether or using a simple fade animation, when the prefers-reduced-motion: reduce media query is true.
Current Behavior 😯
None of the components change behaviour and show the same animation when the media query is true.
Examples 🌈
Here’s the MDN doc for this media query. It’s supported on Chrome, Firefox, and Safari on Windows, Mac, and iOS.
This WebKit blog has several examples of how to support this media query.
Context 🔦
I’m currently adding support for this media query in my web app by disabling page transitions and other custom transitions by using the media query in JSS. But I’m also using MUI’s built-in transition components and there is currently no easy way to disable those animations.
I could use the useMediaQuery hook to modify what my component returns to remove the transition components, but this is quite cumbersome. Supporting this media query directly would make it a lot easier to build more accessible web apps.