Skip to content

Commit

Permalink
Submenus shouldn't take space unless they're actually open.
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen committed May 20, 2021
1 parent 7225a07 commit d2fc624
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,18 @@
}

// Submenu indentation when there's no background.
// It should align with the text above.
left: -1em;
top: 100%;

// Indentation for all submenus.
// Indentation when no background on small viewports.
// It should align with the parent menu above.
.submenu-container,
.wp-block-navigation-link__container {
left: -1px;
}

// Indentation for all submenus on large viewports.
@include break-medium {
.submenu-container,
.wp-block-navigation-link__container {
Expand All @@ -267,11 +275,19 @@
}

// Submenu indentation when there's a background.
// It should align with menu item itself.
&.has-background .has-child .submenu-container,
&.has-background .has-child .wp-block-navigation-link__container {
left: 0;
top: 100%;

// Indentation when there's a background on small viewports.
// It should align with the parent menu above.
.submenu-container,
.wp-block-navigation-link__container {
left: 0;
}

// There's no border on submenus when there are backgrounds.
@include break-medium {
.submenu-container,
Expand Down

0 comments on commit d2fc624

Please sign in to comment.