-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Respects prefers-reduced-motion for content animations. #26286
Conversation
Thanks for the fix, glad we're supporting this a11y option! Just as a note this also won't yet affect story specific amp components with default animations (specifically |
Yep, we'll have to send a second PR to disable animations on all these components (quiz, sidebar, ...). |
@@ -40,6 +40,15 @@ amp-consent { | |||
z-index: initial !important; | |||
} | |||
|
|||
@media (prefers-reduced-motion: reduce) { | |||
*, |
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.
Isn't this going to be a super expensive selector?
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.
I'm not entirely sure, I'm never really worried about CSS selectors usually, only about their properties.
I got most of the information here: https://developers.google.com/web/updates/2019/03/prefers-reduced-motion#bonus_forcing_reduced_motion_on_all_websites
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.
(There's no obvious difference in the metrics the devtools give, but I didn't check the evaluation time)
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.
Sounds good, but worth keeping in mind in case we notice a difference between regular and reduced motion. I was primarily worried because stories often have long and deep DOM trees
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.
Cool feature :)
Respects
prefers-reduced-motion
for AMP story content animations.This does not affect system components for now, but only animations provided by
animate-in
attributes, or custom publisher animations.#24821