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

Submenu item paddings & fixes #35716

Merged
merged 1 commit into from
Oct 18, 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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
width: auto !important;
// These styles are needed to display the dropdown properly when it is empty.
position: absolute;
left: -1em;
left: -1px; // Border width.
top: 100%;

@include break-medium {
Expand Down
12 changes: 5 additions & 7 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,10 @@
// Don't take up space when the menu is collapsed.
width: 0;
height: 0;
overflow: hidden;

// Submenu items.
> .wp-block-navigation-item {
> a {
> .wp-block-navigation-item__content {
display: flex;
flex-grow: 1;

Expand All @@ -142,12 +141,12 @@
}

// Spacing in all submenus.
a {
.wp-block-navigation-item__content {
margin: 0;
}

// Submenu indentation when there's no background.
left: -1em;
left: -1px; // Border width.
top: 100%;

// Indentation for all submenus.
Expand Down Expand Up @@ -184,7 +183,6 @@
opacity: 1;
width: auto;
height: auto;
overflow: initial;
min-width: 200px;
}

Expand Down Expand Up @@ -253,7 +251,7 @@
// https://css-tricks.com/almanac/selectors/w/where/

// Set the default menu item padding to zero, to allow text-only buttons.
.wp-block-navigation a {
.wp-block-navigation .wp-block-navigation-item__content {
padding: 0;
}

Expand All @@ -264,7 +262,7 @@
}

// Provide a default padding for submenus who should always have some, regardless of the top level menu items.
.wp-block-navigation :where(.wp-block-navigation__submenu-container) a {
.wp-block-navigation :where(.wp-block-navigation__submenu-container) .wp-block-navigation-item__content {
padding: 0.5em 1em;
}

Expand Down