Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable justification for burger menu. #31877

Merged
merged 3 commits into from
May 17, 2021
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
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ $color-control-label-height: 20px;
// That means we only have to consider the big adminbar height (<783px).
// And in that view we also know that the toolbar is stacked.
body.admin-bar & {
top: $admin-bar-height-big + $header-height + $block-toolbar-height;
top: $admin-bar-height-big + $header-height + $block-toolbar-height + $border-width;

@include break-medium() {
top: $header-height + $border-width;
Expand Down
28 changes: 26 additions & 2 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@
// This needs high specificity.
&.wp-block-navigation.items-justified-space-between > .submenu-container > .has-child:last-child,
&.wp-block-navigation.items-justified-space-between > .wp-block-navigation__container > .has-child:last-child,
&.wp-block-navigation.items-justified-right .has-child {
&.wp-block-navigation.items-justified-right > .submenu-container .has-child,
&.wp-block-navigation.items-justified-right > .wp-block-navigation__container .has-child {

// First submenu.
.submenu-container,
Expand Down Expand Up @@ -352,6 +353,7 @@
}
}


/**
* Mobile menu.
*/
Expand Down Expand Up @@ -459,9 +461,27 @@

// Button to open the menu.
.wp-block-navigation__responsive-container-open {
display: flex;

@include break-small {
display: none;
}

// Justify the button.
.items-justified-left & {
margin-left: 0;
margin-right: auto;
}

.items-justified-center & {
margin-left: auto;
margin-right: auto;
}

.items-justified-right & {
margin-left: auto;
margin-right: 0;
}
}

// Button to close the menus.
Expand All @@ -472,7 +492,11 @@
z-index: 2; // Needs to be above the modal z index itself.
}

// The menu adds a wrapping container.
// The menu adds wrapping containers.
.wp-block-navigation__responsive-close {
width: 100%;
}

.is-menu-open .wp-block-navigation__responsive-close,
.is-menu-open .wp-block-navigation__responsive-dialog,
.is-menu-open .wp-block-navigation__responsive-container-content {
Expand Down