Skip to content

Commit

Permalink
Fix : "Set featured image" button border flashes on focus (WordPress#…
Browse files Browse the repository at this point in the history
…66092)

* Enable smooth transition of box-shadow for feat. img.

* Remove fallback style and remove transition

Transition is removed to prevent a black border in between transitioning

* Update changelog

* Remove redundant style

Co-authored-by: Vrishabhsk <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: mirka <[email protected]>
Co-authored-by: tyxla <[email protected]>
  • Loading branch information
5 people authored and karthick-murugan committed Nov 13, 2024
1 parent 3e997de commit 2d81395
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Bug Fixes

- `Post Featured Image`: Fix `Set featured image` button's `box-shadow` transition to prevent border from flashing when focused.

## 14.10.0 (2024-10-16)

## 14.9.0 (2024-10-03)
Expand Down
7 changes: 5 additions & 2 deletions packages/editor/src/components/post-featured-image/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
.editor-post-featured-image__preview {
width: 100%;
padding: 0;
transition: all 0.1s ease-out;
@include reduce-motion("transition");
box-shadow: 0 0 0 0 var(--wp-admin-theme-color);
overflow: hidden; // Ensure the focus style properly encapsulates the image.
outline-offset: -#{$border-width};
Expand All @@ -66,6 +64,11 @@

.editor-post-featured-image__toggle {
box-shadow: inset 0 0 0 $border-width $gray-400;

&:focus:not(:disabled) {
// Allow smooth transition between focused and unfocused box-shadow states.
box-shadow: 0 0 0 currentColor inset, 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
}

.editor-post-featured-image__actions {
Expand Down

0 comments on commit 2d81395

Please sign in to comment.