-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a11y: Add missing reduce-motion
mixin
#68282
Comments
Hey @t-hamano, Thanks for raising this. I will raise a PR to fix this. |
@himanshupathak95 Thanks for addressing this issue. If you don't mind, could you provide some screenshots of which components each of the reduce-motion mixins affects so we can make sure they work as expected? Also, you don't need to tackle them all at once. If there are too many to tackle, you can tackle them package by package. |
@t-hamano, I am thinking of doing this package by package since there are a lot of places that need to change and there must be distinction amongst them to test and discuss each package correctly in isolation. I am thinking maybe we can create separate PRs to track packages specifically and execute the changes so we don't break anything. Please let me know what you think. |
Yes, I think it's a good idea to submit a PR for each package 👍 |
No strong opinion, but I wanted to note that in @media not ( prefers-reduced-motion ) {
transition: all 400ms linear;
} It isn't any less ergonomic, it's immediately understandable without knowledge of a custom mixin implementation, and we end up with fewer lines of CSS. Would it be worth considering this pattern for the wider codebase as well? |
@mirka Thanks for the feedback!
That's a good idea. I think it might be better to proceed in the following order:
|
What problem does this address?
If we use transition or animation CSS, we are expected to use the
reduce-motion
mixin. Example:This code compiles to the following to respect the user's preference and disable animations:
However, there are many places where
transition
oranimation
is used without this mixin.What is your proposed solution?
We could update stylelint to enforce this rule, but since this is a custom rule, we would need to add our own plugin. I'm not sure if it would be worth creating a custom plugin to enforce this rule. For now, I think it's best to find the missing mixin and add it.
Steps to get started
transition:
oranimation:
in the.scss
files in the Gutenberg project.none
.reduce-motion
mixin exists. If it doesn't exist, we may need one.reduce
.https://developer.chrome.com/docs/devtools/rendering/emulate-css#emulate_css_media_feature_prefers-reduced-motion
The text was updated successfully, but these errors were encountered: