Skip to content

Commit

Permalink
Fix : Secondary Button Transition (WordPress#66045)
Browse files Browse the repository at this point in the history
* Modify box-shadow to allow transition delay

* Replace hex with

* Replace $black with currentColor

* Update changelog

---------

Co-authored-by: Marin Atanasov <[email protected]>

Co-authored-by: Vrishabhsk <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
4 people authored and karthick-murugan committed Nov 13, 2024
1 parent 8ad6551 commit 213a39c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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 @@
- `RangeControl`: do not tooltip contents to the DOM when not shown ([#65875](https://github.com/WordPress/gutenberg/pull/65875)).
- `Tabs`: fix skipping indication animation glitch ([#65878](https://github.com/WordPress/gutenberg/pull/65878)).
- `ToggleGroupControl`: Don't autoselect option on first group focus ([#65892](https://github.com/WordPress/gutenberg/pull/65892)).
- `Button`: fix `box-shadow` transition for secondary variation ([#66045](https://github.com/WordPress/gutenberg/pull/66045)).

### Deprecations

Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
*/

&.is-secondary {
box-shadow: inset 0 0 0 $border-width $components-color-accent;
box-shadow: inset 0 0 0 $border-width $components-color-accent, 0 0 0 currentColor;
outline: 1px solid transparent; // Shown in high contrast mode.
white-space: nowrap;
color: $components-color-accent;
Expand All @@ -148,6 +148,10 @@
&[aria-disabled="true"]:hover:not(:focus) {
box-shadow: inset 0 0 0 $border-width $gray-300;
}

&:focus:not(:disabled) {
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
}
}

/**
Expand Down

0 comments on commit 213a39c

Please sign in to comment.