Skip to content

Commit

Permalink
Updated unstyledButton hover selector to change fill of svg and path …
Browse files Browse the repository at this point in the history
…element (#50819)

* Updated unstyledButton hover selector to change fill of svg and path elements

* Changed placement svg selector and used css constant currentColor

* Deleted :focus selector since it overrides browser default :focus-visible

* Updated test snapshots

* Update changelog

* Fix PR URL in changelog

* Fix indentation in CHANGELOG.md

---------

Co-authored-by: Sarah Norris <[email protected]>
  • Loading branch information
n2erjo00 and mikachan authored Jun 9, 2023
1 parent b7432c8 commit 524d6ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Wrapped `TabPanel` in a `forwardRef` call ([#50199](https://github.com/WordPress/gutenberg/pull/50199)).
- `ColorPalette`: Improve readability of color name and value, and improve rendering of partially transparent colors ([#50450](https://github.com/WordPress/gutenberg/pull/50450)).
- `Button`: Add `__next32pxSmallSize` prop to opt into the new 32px size when the `isSmall` prop is enabled ([#51012](https://github.com/WordPress/gutenberg/pull/51012)).
- `ItemGroup`: Update styles so all SVGs inherit color from their parent element ([#50819](https://github.com/WordPress/gutenberg/pull/50819)).

### Experimental

Expand Down
10 changes: 4 additions & 6 deletions packages/components/src/item-group/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ export const unstyledButton = css`
background: none;
text-align: start;
&:hover {
color: ${ COLORS.ui.theme };
svg,
path {
fill: currentColor;
}
&:focus {
background-color: transparent;
&:hover {
color: ${ COLORS.ui.theme };
border-color: ${ COLORS.ui.theme };
outline: 3px solid transparent;
}
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,15 +607,13 @@ exports[`EditPostPreferencesModal should match snapshot when the modal is active
border-radius: 2px;
}
.emotion-13:hover {
color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
.emotion-13 svg,
.emotion-13 path {
fill: currentColor;
}
.emotion-13:focus {
background-color: transparent;
.emotion-13:hover {
color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
border-color: var(--wp-components-color-accent, var(--wp-admin-theme-color, #3858e9));
outline: 3px solid transparent;
}
.emotion-15 {
Expand Down

1 comment on commit 524d6ef

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in 524d6ef.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5222663205
📝 Reported issues:

Please sign in to comment.