-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Improve Button
saving state accessibility.
#55547
Conversation
Button
saving state accessibility.
Size Change: +1.33 kB (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in d79707f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6945368659
|
d66fa1f
to
807520e
Compare
807520e
to
d79707f
Compare
Rebased on top of latest trunk. |
The optional check |
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.
Haven't had time to fully test, but seems fine, left a comment.
@@ -242,6 +242,9 @@ | |||
&.is-secondary.is-busy:disabled, | |||
&.is-secondary.is-busy[aria-disabled="true"] { | |||
animation: components-button__busy-animation 2500ms infinite linear; | |||
@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.
I think you could use @include reduce-motion("animation");
instead of this whole query.
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.
@jasmussen thanks, as I mentioned in this PR description:
Note that is not possible to use the reduce-motion mixin because it sets
animation-duration: 1ms
but it doesn't resetanimation-iteration-count
which isinfinite
for this specific animation. I don't know why the reduce-motion mixin doesn't reset all the animation properties to 0 but it would be better to revisit it to have a mixin that is guaranteed to work with all animations / transitions.
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.
Oh I missed this. Can we update the mixin? I don't see why we shouldn't. If you do, be sure to restart npm run dev for the mixin to take.
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.
Oh I missed this. Can we update the mixin?
Yes of course, but I'd recommend a separate PR. I did already open #55566 in fact.
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 to me. At most we could add an inline comment suggesting that we should refactor it to using @include reduce-motion("animation");
as soon as #55566 is closed
Been busy with a few things this past couple of days, I'll try to take a look tomorrow. |
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 🚀
Thank you for working on this
@@ -242,6 +242,9 @@ | |||
&.is-secondary.is-busy:disabled, | |||
&.is-secondary.is-busy[aria-disabled="true"] { | |||
animation: components-button__busy-animation 2500ms infinite linear; | |||
@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.
Sounds good to me. At most we could add an inline comment suggesting that we should refactor it to using @include reduce-motion("animation");
as soon as #55566 is closed
Fixes #55545
What?
The saving buttons animation doesn't respect the OS-level preference 'Reduce motion'.
Additioanlly, the gray saving button doesn't have a sufficient color contrast ratio.
Why?
All animaitons should be disabled when users enable the OS-level preference 'Reduce motion'. This is even more important for animations that could potentially trigger seizure.
How?
reduce-motion
mixin because it setsanimation-duration: 1ms
but it doesn't resetanimation-iteration-count
which isinfinite
for this specific animation. I don't know why thereduce-motion
mixin doesn't reset all the animation properties to 0 but it would be better to revisit it to have a mixin that is guaranteed to work with all animations / transitions.gray-900
for the gray saving button text.Testing Instructions
#1e1e1e
has now a sufficient color contrast with the gray colors used in the background gradient#fafafa
and#e0e0e0
.Testing Instructions for Keyboard
Screenshots or screencast