Skip to content

Commit

Permalink
Snackbar: Use link variant for action Button (#66560)
Browse files Browse the repository at this point in the history
* Snackbar: Use `link` variant for action button

* Add changelog

Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>
  • Loading branch information
3 people authored Oct 30, 2024
1 parent cd476fd commit e62588a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 17 deletions.
4 changes: 4 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Internal

- `Snackbar`: Use link variant for action Button ([#66560](https://github.com/WordPress/gutenberg/pull/66560)).

## 28.11.0 (2024-10-30)

### Deprecations
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/snackbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ function UnforwardedSnackbar(
{ actions.map( ( { label, onClick, url }, index ) => {
return (
<Button
__next40pxDefaultSize
key={ index }
href={ url }
variant="tertiary"
variant="link"
onClick={ (
event: MouseEvent< HTMLButtonElement >
) => onActionClick( event, onClick ) }
Expand Down
23 changes: 7 additions & 16 deletions packages/components/src/snackbar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,16 @@
.components-snackbar__action.components-button {
margin-left: $grid-unit-40;
color: $white;
height: auto;
flex-shrink: 0;
line-height: $default-line-height;
padding: 0;

&:not(:disabled):not([aria-disabled="true"]):not(.is-secondary) {
text-decoration: underline;
background-color: transparent;

&:focus {
color: $white;
box-shadow: none;
outline: 1px dotted $white;
}
&:focus {
box-shadow: none;
outline: 1px dotted $white;
}

&:hover {
text-decoration: none;
color: $white;
}
&:hover {
text-decoration: none;
color: currentColor;
}
}

Expand Down

0 comments on commit e62588a

Please sign in to comment.