Skip to content

Commit

Permalink
Improve Button saving state accessibility. (#55547)
Browse files Browse the repository at this point in the history
* Make saving buttons honor prefers-reduced-motion.

* Fix edit site save hub button color contrast.

* Add changelog entry.

* Add inline comment.
  • Loading branch information
afercia authored Nov 24, 2023
1 parent 4d99bc2 commit 1fb0d7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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 @@ -245,6 +245,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) {
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;
}
}
}

0 comments on commit 1fb0d7b

Please sign in to comment.