-
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
Edit Site: Standardize reduced motion handling using media queries #68419
Edit Site: Standardize reduced motion handling using media queries #68419
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Hey @t-hamano, Please review these changes whenever you get a moment and let me know if the changes are as expected. Thanks 😇 |
packages/edit-site/src/components/global-styles/font-library-modal/style.scss
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! It's working correctly in every component.
Thank you @gziolo I debugged and found that the issue arises from this place. All other file changes are not causing any issues, but this one is. The preprocessor is converting the SCSS to the following, as shown in the screenshot above. It was incorrectly compiling the not and the &. Codegutenberg/packages/edit-site/src/components/layout/style.scss Lines 111 to 133 in 5b06788
The previous compiled code with wrong parenthisis [1] 2575 │ @media (min-width: 782px) and (not (prefers-reduced-motion)) { Changing the code to the following solves the issue: Reference @media (prefers-reduced-motion: no-preference) {
transition: border-radius, box-shadow 0.4s;
} New compiled code: @media (min-width: 782px) and (prefers-reduced-motion: no-preference) {
.edit-site-layout__canvas .edit-site-resizable-frame__inner-content {
transition: border-radius, box-shadow 0.4s;
}
} |
@im3dabasia Thanks for looking into it! I think we can go with that hotfix for now. Though, we'll want some additional measures to prevent this from happening again:
cc @WordPress/gutenberg-components for awareness. |
Part of: #68282
What?
Replace the reduce-motion mixin with
@media not (prefers-reduced-motion)
media queries across all components in the edit-site package. This standardizes how we handle reduced motion preferences throughout the codebase.Testing Instructions
Enable the Site Editor
Test each component that has animations:
Verify animations work normally
In your system preferences, enable reduced motion:
Verify that animations are disabled when reduced motion is enabled
Screencast
Screen.Recording.2025-01-02.at.07.57.14.mov
Screen.Recording.2025-01-02.at.08.16.30.mov