Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background image: move controls into a popover #60151

Merged
merged 11 commits into from
Jul 3, 2024
Prev Previous commit
Next Next commit
Fix hack to push popover into the background
  • Loading branch information
ramonjd committed Jul 3, 2024
commit 37dd1e2e06aa0a5bdfc0b486bff7deaed0218171
4 changes: 3 additions & 1 deletion packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ $z-layers: (
// Needs to be below media library that has a z-index of 160000.
"{core/video track editor popover}": 160000 - 10,

// Needs to be below media library that has a z-index of 160000.
// Needs to be below media library (.media-model) that has a z-index of 160000.
".block-editor-format-toolbar__image-popover": 160000 - 10,
// Below the media library backdrop (.media-modal-backdrop), which has a z-index of 159900.
".block-editor-global-styles-background-panel__popover": 159900 - 10,

// Small screen inner blocks overlay must be displayed above drop zone,
// settings menu, and movers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const BACKGROUND_POPOVER_PROPS = {
placement: 'left-start',
offset: 36,
shift: true,
className: 'block-editor-global-styles-background-panel__popover',
};
const noop = () => {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@
position: absolute;
}

// Hack to push into background when the media modal is open.
// @TODO how to target the background panel specifically?
.modal-open .components-dropdown__content {
z-index: 100000;
// Push control panel into the background when the media modal is open.
.modal-open .block-editor-global-styles-background-panel__popover {
z-index: z-index(".block-editor-global-styles-background-panel__popover");
}