Skip to content

Commit

Permalink
Fixed a series of z-index related issues, that made other elements ap…
Browse files Browse the repository at this point in the history
…pear in front of the sidebar on mobile. (#5165)
  • Loading branch information
jorgefilipecosta authored Feb 27, 2018
1 parent cc87946 commit 9162e4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion edit-post/assets/stylesheets/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ $z-layers: (
'.editor-block-mover': 1,
'.blocks-gallery-item__inline-menu': 20,
'.editor-block-settings-menu__popover': 20, // Below the header
'.blocks-url-input__suggestions': 30,
'.edit-post-header': 30,
'.wp-block-image__resize-handlers': 1, // Resize handlers above sibling inserter

Expand All @@ -37,6 +38,10 @@ $z-layers: (
'.edit-post-sidebar': 100000,
'.edit-post-layout .edit-post-post-publish-panel': 100001,

// Show sidebar in greater than small viewports above editor related elements
// but bellow #adminmenuback { z-index: 100 }
'.edit-post-sidebar {greater than small}': 50,

// Show notices below expanded wp-admin submenus:
// #adminmenuwrap { z-index: 9990 }
'.components-notice-list': 9989,
Expand All @@ -45,7 +50,6 @@ $z-layers: (
// #adminmenuwrap { z-index: 9990 }
'.components-popover': 1000000,
'.components-autocomplete__results': 1000000,
'.blocks-url-input__suggestions': 9999,
);

@function z-index( $key ) {
Expand Down
2 changes: 1 addition & 1 deletion edit-post/components/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@include break-small() {
top: $admin-bar-height-big + $header-height;
z-index: auto;
z-index: z-index( '.edit-post-sidebar {greater than small}' );
height: auto;
overflow: auto;
-webkit-overflow-scrolling: touch;
Expand Down

0 comments on commit 9162e4c

Please sign in to comment.