Skip to content
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

[css-view-transitions-1] Don't animate transform/size by default when prefers-reduced-motion is on #10996

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion css-view-transitions-1/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,14 @@ urlPrefix: https://wicg.github.io/navigation-api/; type: interface;
backdrop-filter: <var>backdropFilter</var>;
}
}

@media (prefers-reduced-motion) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thinking here was to reset the animation property on the group pseudo instead of modifying the keyframe. So if the author does want to reinstate the size/position animation they'll have access to the keyframe. But I didn't realize that other properties are part of this keyframe too.

And actually more will be added with the new capture mode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a WPT test for this? Asking b/c I don't know offhand if the user preference media features can be tested in WPT. If not, merging this PR may be dependent on that test-ability requirement.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not currently testable. See web-platform-tests/wpt#14839

@keyframes -ua-view-transition-group-anim-<var>transitionName</var> {
from {
backdrop-filter: <var>backdropFilter</var>;
}
}
}
</pre>

Note: The above code example contains variables to be replaced.
Expand Down Expand Up @@ -1987,7 +1995,7 @@ Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230
* Fix scoping to match name instead of element. See <a href="https://github.com/w3c/csswg-drafts/issues/10145">issue 10145</a>.
* Add a rendering characteristics note about out-of-viewport elements. See <a href="https://github.com/w3c/csswg-drafts/issues/8282">issue 8282</a>.
* Swap the order of invoking the update callback and setting the phase. See <a href="https://github.com/w3c/csswg-drafts/issues/10822">issue 10822</a>.

* Don't animate transform/size by default when `prefers-reduced-motion` is on. See <a href="https://github.com/w3c/csswg-drafts/issues/10267">issue 10267</a>.
<h3 id="changes-since-2022-05-25">
Changes from <a href="https://www.w3.org/TR/2023/WD-css-view-transitions-1-20230525/">2022-05-25 Working Draft</a>
</h3>
Expand Down