Skip to content

Support for prefers-reduced-motion #16367

@notsidney

Description

@notsidney
  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

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.

Metadata

Metadata

Assignees

Labels

accessibilitya11yscope: all componentsWidespread work has an impact on almost all components.type: new featureExpand the scope of the product to solve a new problem.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions