-
Notifications
You must be signed in to change notification settings - Fork 140
View-Transitions: Respect prefers-reduced-motion settings #2068
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
View-Transitions: Respect prefers-reduced-motion settings #2068
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. |
westonruter
left a comment
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
felixarntz
left a comment
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.
@mediaformat Thank you for creating the PR. You are raising a great point in that we need to figure out how to respect accessibility preferences in regards to view transitions. That said, I think there needs to be a bit more discussion on how to approach it the best way, so I'm marking this as requesting changes only to make sure we can make an educated decision. To me, the approach of wrapping with prefers-reduced-motion could work, but I would like to get additional accessibility experts to weigh in on the approach.
Let's discuss on the issue before proceeding here.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## trunk #2068 +/- ##
=======================================
Coverage 67.14% 67.14%
=======================================
Files 93 93
Lines 7740 7740
=======================================
Hits 5197 5197
Misses 2543 2543
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@felixarntz updated with discussed changes, wrapping the injected transition stylesheets with a |
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.
@mediaformat Thanks, this looks great!
Now that #2051 (and #2078) was merged, this has a merge conflict, but it should be straightforward to fix. As discussed on the issue, we'll need to wrap the animation duration code as well.
I think you can simply move the change here to the updated line where the code adds the $default_animation_stylesheet inline style.
fe7c835 to
b213343
Compare
felixarntz
left a comment
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.
@mediaformat Thank you for the iterations, LGTM!
Summary
Fixes #2067
Relevant technical choices
Wrapped the initializing
@view-transitioninline style with a check forprefers-reduced-motion: no-preference, so that the animation effects are NOT applied ifprefers-reduced-motionis true.Screen.Recording.2025-06-25.at.1.34.12.PM.mov