Skip to content

Commit

Permalink
Polish Autocomplete popover (#60131)
Browse files Browse the repository at this point in the history
* Try accent background

* Improve focus/active

* update changelog

---------

Co-authored-by: richtabor <richtabor@git.wordpress.org>
Co-authored-by: draganescu <andraganescu@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Co-authored-by: jasmussen <joen@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
  • Loading branch information
7 people authored Apr 22, 2024
1 parent a4cf311 commit 7cb5b75
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@

- `TextControl`: Add typings for `date`, `time` and `datetime-local` ([#59666](https://github.com/WordPress/gutenberg/pull/59666)).
- `Text`, `Heading`, `ItemGroup` : Update the line height from 1.2 to 1.4 ([#60041](https://github.com/WordPress/gutenberg/pull/60041)).
- `Autocomplete` : match the autocomplete styling to that of List View and Command Palette([#60131](https://github.com/WordPress/gutenberg/pull/60131)).

### Deprecation

Expand Down
14 changes: 10 additions & 4 deletions packages/components/src/autocomplete/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.components-autocomplete__popover .components-popover__content {
padding: $grid-unit-20;
min-width: 220px;
padding: $grid-unit-10;
min-width: 200px;
}

.components-autocomplete__result.components-button {
Expand All @@ -10,7 +10,13 @@
text-align: left;
width: 100%;

&.is-selected {
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
&:focus:not(:disabled) {
@include block-toolbar-button-style__focus();
}

&.is-selected,
&:not(:disabled,[aria-disabled="true"]):active {
background: $components-color-accent;
color: $white;
}
}

0 comments on commit 7cb5b75

Please sign in to comment.