Skip to content

Commit

Permalink
ItemGroup: Update button focus styles to use :focus-visible (#51787)
Browse files Browse the repository at this point in the history
* Use focus-visible rather than focus on ItemGroup buttons

* Update snapshot

* Update Changelog
  • Loading branch information
mikachan authored and tellthemachines committed Jun 27, 2023
1 parent be4546d commit b909d90
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- `Modal`: Update corner radius to be between buttons and the site view frame, in a 2-4-8 system. ([#51254](https://github.com/WordPress/gutenberg/pull/51254)).
- `Button`: Introduce `size` prop with `default`, `compact`, and `small` variants ([#51842](https://github.com/WordPress/gutenberg/pull/51842)).
- `ItemGroup`: Update button focus state styles to be inline with other button focus states in the editor. ([#51576](https://github.com/WordPress/gutenberg/pull/51576)).
- `ItemGroup`: Update button focus state styles to target `:focus-visible` rather than `:focus`. ([#51787](https://github.com/WordPress/gutenberg/pull/51787)).

### Bug Fix

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/item-group/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const unstyledButton = css`
color: ${ COLORS.ui.theme };
}
&:focus {
&:focus-visible {
box-shadow: 0 0 0 var( --wp-admin-border-width-focus )
var(
--wp-components-color-accent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
}
.emotion-13:focus {
.emotion-13:focus-visible {
box-shadow: 0 0 0 var( --wp-admin-border-width-focus ) var(
--wp-components-color-accent,
var( --wp-admin-theme-color, var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9)) )
Expand Down

0 comments on commit b909d90

Please sign in to comment.