diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 07ba399dabceb..7909e92891194 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -365,7 +365,7 @@ A collection of blocks that allow visitors to get around your site. ([Source](ht - **Name:** core/navigation - **Category:** theme -- **Supports:** align (full, wide), anchor, inserter, spacing (units), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align (full, wide), anchor, inserter, spacing (blockGap, units), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** __unstableLocation, backgroundColor, customBackgroundColor, customOverlayBackgroundColor, customOverlayTextColor, customTextColor, openSubmenusOnClick, overlayBackgroundColor, overlayMenu, overlayTextColor, ref, rgbBackgroundColor, rgbTextColor, showSubmenuIcon, textColor ## Navigation Area diff --git a/packages/block-library/src/navigation/block.json b/packages/block-library/src/navigation/block.json index 6759cde277fa2..96a049e9f0bad 100644 --- a/packages/block-library/src/navigation/block.json +++ b/packages/block-library/src/navigation/block.json @@ -92,7 +92,11 @@ } }, "spacing": { - "units": [ "px", "em", "rem", "vh", "vw" ] + "blockGap": true, + "units": [ "px", "em", "rem", "vh", "vw" ], + "__experimentalDefaultControls": { + "blockGap": true + } }, "__experimentalLayout": { "allowSwitching": false, diff --git a/packages/block-library/src/navigation/style.scss b/packages/block-library/src/navigation/style.scss index 961762f861442..0139ba5fff9d7 100644 --- a/packages/block-library/src/navigation/style.scss +++ b/packages/block-library/src/navigation/style.scss @@ -306,11 +306,14 @@ button.wp-block-navigation-item__content { */ // Menu items with no background. +.wp-block-navigation__responsive-container, +.wp-block-navigation__responsive-close, +.wp-block-navigation__responsive-dialog, .wp-block-navigation, .wp-block-navigation .wp-block-page-list, .wp-block-navigation__container, .wp-block-navigation__responsive-container-content { - gap: var(--wp--style--block-gap, 2em); + gap: inherit; } // Menu items with background. @@ -321,7 +324,7 @@ button.wp-block-navigation-item__content { &, .wp-block-navigation .wp-block-page-list, .wp-block-navigation__container { - gap: var(--wp--style--block-gap, 0.5em); + gap: inherit; } } @@ -509,7 +512,7 @@ button.wp-block-navigation-item__content { // Space unfolded items using gap and padding for submenus. .wp-block-navigation__submenu-container, .wp-block-navigation__container { - gap: var(--wp--style--block-gap, 2em); + gap: inherit; } // Apply top padding to nested submenus.