Skip to content

Commit

Permalink
Fix transparent navigation block submenus (#28904)
Browse files Browse the repository at this point in the history
* Fix submenu backgrounds

* Ensure submenus are the same width regardless of bg color, and align items left

* Switch to stretch as items should be full-width of the container

* Use align-items normal

* Fix issue with glitching appender.

Co-authored-by: jasmussen <[email protected]>
  • Loading branch information
talldan and jasmussen authored Feb 10, 2021
1 parent 9a5fef7 commit 94cc72e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/block-library/src/navigation-link/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
margin: $grid-unit-10 * 2;
margin-left: $grid-unit-10 * 1.25;
margin-top: $grid-unit-10 * 1.25;
margin-right: auto;
}
}

Expand Down
28 changes: 19 additions & 9 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
// Default background and font color
.wp-block-navigation:not(.has-background) .wp-block-navigation__container {
.wp-block-navigation__container {
// Set a background color for submenus so that they're not transparent.
// NOTE TO DEVS - if refactoring this code, please double-check that
// submenus have a default background color, this feature has regressed
// several times, so care needs to be taken.
background-color: $white;
color: $gray-900;
}
}

.wp-block-navigation .wp-block-navigation__container {
.wp-block-navigation__container {
align-items: normal;
min-width: 200px;
}
}

.wp-block-navigation__container {
// Vertically align child blocks, like Social Links or Search.
align-items: center;

// Default background and font color
&:not(.has-background) .wp-block-navigation__container {
.wp-block-navigation__container {
color: $gray-900;
background-color: $white;
min-width: 200px;
}
}
}

.items-justified-center > ul {
Expand Down

0 comments on commit 94cc72e

Please sign in to comment.