Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
- `BorderControl`, `ColorPicker` & `QueryControls`: Replace bottom margin overrides with `__nextHasNoMarginBottom` ([#45985](https://github.com/WordPress/gutenberg/pull/45985)).
- `CustomSelectControl`, `UnitControl`: Add `onFocus` and `onBlur` props ([#46096](https://github.com/WordPress/gutenberg/pull/46096)).
- `ResizableBox`: Prevent unnecessary paint on resize handles ([#46196](https://github.com/WordPress/gutenberg/pull/46196))
- `Popover`: Prevent unnecessary paint caused by using outline ([#46201](https://github.com/WordPress/gutenberg/pull/46201))

### Experimental

Expand Down
22 changes: 11 additions & 11 deletions packages/components/src/popover/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
$arrow-triangle-base-size: 14px;

$shadow-popover-border-default: 0 0 0 $border-width $gray-400;
$shadow-popover-border-default-alternate: 0 0 0 $border-width $gray-900;
$shadow-popover-border-top-only: 0 #{-$border-width} 0 0 $gray-400;
$shadow-popover-border-top-only-alternate: 0 #{-$border-width} 0 $gray-900;

.components-popover {
z-index: z-index(".components-popover");

Expand All @@ -15,26 +20,20 @@ $arrow-triangle-base-size: 14px;

.components-popover__content {
background: $white;
// Using outline instead of border to avoid impacting
// popover computations.
outline: $border-width solid $gray-400;
box-shadow: $shadow-popover;
box-shadow: $shadow-popover-border-default, $shadow-popover;
border-radius: $radius-block-ui;
box-sizing: border-box;
width: min-content;

// Alternate treatment for popovers that put them at elevation zero with high contrast.
.is-alternate & {
outline: $border-width solid $gray-900;
box-shadow: none;
box-shadow: $shadow-popover-border-default-alternate;
}

// A style that gives the popover no visible ui.
.is-unstyled & {
background: none;
border: none;
border-radius: 0;
outline: none;
box-shadow: none;
}

Expand All @@ -43,9 +42,10 @@ $arrow-triangle-base-size: 14px;
height: calc(100% - #{ $panel-header-height });
overflow-y: visible;
width: auto;
border: none;
outline: none;
border-top: $border-width solid $gray-900;
box-shadow: $shadow-popover-border-top-only;
}
.components-popover.is-expanded.is-alternate & {
box-shadow: $shadow-popover-border-top-only-alternate;
}
}

Expand Down