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

Improve Button saving state accessibility. #55547

Merged
merged 4 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
### Bug Fix

- `Autocomplete`: Add `aria-live` announcements for Mac and IOS Voiceover to fix lack of support for `aria-owns` ([#54902](https://github.com/WordPress/gutenberg/pull/54902)).
- Improve Button saving state accessibility. ([#55547](https://github.com/WordPress/gutenberg/pull/55547))

### Internal

Expand Down
5 changes: 5 additions & 0 deletions packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@
&.is-secondary.is-busy:disabled,
&.is-secondary.is-busy[aria-disabled="true"] {
animation: components-button__busy-animation 2500ms infinite linear;
// This should be refactored to use the reduce-motion("animation") mixin
// as soon as https://github.com/WordPress/gutenberg/issues/55566 is closed.
@media (prefers-reduced-motion: reduce) {
Copy link
Contributor

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.

Copy link
Contributor Author

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 reset animation-iteration-count which is infinite 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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

animation-duration: 0s;
}
opacity: 1;
background-size: 100px 100%;
// Disable reason: This function call looks nicer when each argument is on its own line.
Expand Down
7 changes: 7 additions & 0 deletions packages/edit-site/src/components/save-hub/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,11 @@
&[aria-disabled="true"]:hover {
color: inherit;
}

&:not(.is-primary) {
&.is-busy,
&.is-busy[aria-disabled="true"]:hover {
color: $gray-900;
}
}
}