Skip to content

Commit

Permalink
Search: Fix focus and active states on search button
Browse files Browse the repository at this point in the history
The focus styles should be on `:focus` to apply when the button is clicked. Remove the border from `:active` to fix a layout shift.

Fixes #117.
  • Loading branch information
ryelle committed Jan 12, 2024
1 parent 5944170 commit d6b8250
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,14 @@
.wp-block-search__input,
.wp-block-search__button {
&:focus {
outline: none;
outline-offset: unset;
background-color: var(--wp--custom--form--search--color--background);
}

&:focus-visible {
outline: 1.5px solid var(--local--focus--outline-color);
outline-offset: -1.5px;
box-shadow: inset 0 0 0 3px var(--local--focus--border-color);
}

&:active {
border: none;
}
}

&.wp-block-search__icon-button .wp-block-search__button {
Expand Down

0 comments on commit d6b8250

Please sign in to comment.