Skip to content

Commit

Permalink
Navigation: Page List fix missing padding. (#43358)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen authored Aug 19, 2022
1 parent ac4d4b0 commit b7e6b99
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,17 @@ button.wp-block-navigation-item__content {
// We use :where to keep specificity minimal, yet still scope it to only the navigation block.
// That way if padding is set in theme.json, it still wins.
// https://css-tricks.com/almanac/selectors/w/where/
// Note: .wp-block-navigation-item targets both Page List and custom menu items. .wp-block-navigation-link targets only custom.

// When the menu has a background, items have paddings, reduce margins to compensate.
// Treat margins and paddings differently when the block has a background.
:where(.wp-block-navigation.has-background .wp-block-navigation-link a:not(.wp-element-button)),
:where(.wp-block-navigation.has-background .wp-block-navigation-item a:not(.wp-element-button)),
:where(.wp-block-navigation.has-background .wp-block-navigation-submenu a:not(.wp-element-button)) {
padding: 0.5em 1em;
}

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

0 comments on commit b7e6b99

Please sign in to comment.