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
3 changes: 2 additions & 1 deletion packages/base-styles/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

### Breaking Changes

- Remove the following entries from the `z-index()` helper ([#78315](https://github.com/WordPress/gutenberg/pull/78315)):
- Remove the following entries from the `z-index()` helper ([#78315](https://github.com/WordPress/gutenberg/pull/78315), [#78362](https://github.com/WordPress/gutenberg/pull/78362)):
- `.components-modal__header`
- `.dataviews-footer`
- `.dataviews-view-grid__card .dataviews-selection-checkbox`
- `.dataviews-view-table thead`
Expand Down
1 change: 0 additions & 1 deletion packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
$z-layers: (
".block-editor-block-list__block.is-selected": 20,

".components-modal__header": 10,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value looks high enough to seem like it's participating in some kind of global coordination, but its parent stacking context is within the Modal component (.components-modal__frame), so it's not a global concern.

".edit-post-layout__footer": 30,
".interface-interface-skeleton__header": 30,
".interface-interface-skeleton__content": 20,
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/modal/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@
align-items: center;
height: $header-height + $grid-unit-10; // 72px
width: 100%;
z-index: z-index(".components-modal__header");
// Stack above modal content that may overlap the header.
z-index: 10;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value looks arbitrary and no specific reasoning is given in the original PR that introduced it. However, given how long this specific value has been around (seven years), and how consumers very often override modal styles using internal classes, there are definitely cases where changing the value could cause a regression.

Since we have a cleaner replacement in the pipeline (Dialog), I think it would be fine to keep this magic value for this legacy component.

position: absolute;
top: 0;
left: 0;
Expand Down
Loading