diff --git a/packages/base-styles/_z-index.scss b/packages/base-styles/_z-index.scss index 9ef4302f32d66c..230c98893e1d07 100644 --- a/packages/base-styles/_z-index.scss +++ b/packages/base-styles/_z-index.scss @@ -25,7 +25,7 @@ $z-layers: ( ".block-library-gallery-item__inline-menu": 20, ".block-editor-url-input__suggestions": 30, ".edit-post-layout__footer": 30, - ".edit-post-header": 30, + ".edit-post-editor-regions__header": 30, ".edit-widgets-header": 30, ".block-library-button__inline-link .block-editor-url-input__suggestions": 6, // URL suggestions for button block above sibling inserter ".block-library-image__resize-handlers": 1, // Resize handlers above sibling inserter @@ -75,7 +75,8 @@ $z-layers: ( // Show sidebar in greater than small viewports above editor related elements // but bellow #adminmenuback { z-index: 100 } - ".edit-post-sidebar {greater than small}": 90, + ".edit-post-editor-regions__sidebar {greater than small}": 90, + ".edit-widgets-sidebar {greater than small}": 90, // Show notices below expanded editor bar // .edit-post-header { z-index: 30 } diff --git a/packages/edit-post/src/components/editor-regions/style.scss b/packages/edit-post/src/components/editor-regions/style.scss index ef0d452451fb11..ead37c07d9c2a6 100644 --- a/packages/edit-post/src/components/editor-regions/style.scss +++ b/packages/edit-post/src/components/editor-regions/style.scss @@ -53,6 +53,7 @@ right: 0; bottom: 0; left: 0; + background: $white; &:empty { display: none; @@ -63,7 +64,7 @@ overflow: auto; border-left: $border-width solid $light-gray-500; position: relative !important; - z-index: initial; + z-index: z-index(".edit-post-editor-regions__sidebar {greater than small}"); } } @@ -71,14 +72,19 @@ flex-shrink: 0; height: auto; // Keep the height flexible. border-bottom: $border-width solid $light-gray-500; + z-index: z-index(".edit-post-editor-regions__header"); // On Mobile the header is sticky. position: sticky; top: 0; + + @include break-small() { + top: $admin-bar-height-big; // The top bar is fixed on this breakpoint. + } + @include break-medium() { // Cancel the fixed positionning used in mobile. position: initial; - overflow: auto; } } diff --git a/packages/edit-post/src/components/header/style.scss b/packages/edit-post/src/components/header/style.scss index 466a6cc6280127..1abac2f94eeabb 100644 --- a/packages/edit-post/src/components/header/style.scss +++ b/packages/edit-post/src/components/header/style.scss @@ -8,7 +8,6 @@ align-items: center; // The header should never be wider than the viewport, or buttons might be hidden. Especially relevant at high zoom levels. Related to https://core.trac.wordpress.org/ticket/47603#ticket. max-width: 100vw; - z-index: z-index(".edit-post-header"); // Make toolbar sticky on larger breakpoints @include break-zoomed-in { diff --git a/packages/edit-widgets/src/components/sidebar/style.scss b/packages/edit-widgets/src/components/sidebar/style.scss index 53bab2c7ffac8d..5c744d535f45b7 100644 --- a/packages/edit-widgets/src/components/sidebar/style.scss +++ b/packages/edit-widgets/src/components/sidebar/style.scss @@ -13,7 +13,7 @@ @include break-small() { top: $admin-bar-height-big + $header-height; - z-index: z-index(".edit-post-sidebar {greater than small}"); + z-index: z-index(".edit-widgets-sidebar {greater than small}"); height: auto; overflow: auto; -webkit-overflow-scrolling: touch;