From 392a575ff25fab618abe0b584af3c098999d9dc8 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Wed, 22 Dec 2021 17:50:49 +1300 Subject: [PATCH] Fallback to theme default block gap setting if not explicitly set on block --- packages/block-library/src/navigation/edit/inner-blocks.js | 4 +++- packages/block-library/src/navigation/index.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/navigation/edit/inner-blocks.js b/packages/block-library/src/navigation/edit/inner-blocks.js index f4d7fa76600ad3..876f5493568e89 100644 --- a/packages/block-library/src/navigation/edit/inner-blocks.js +++ b/packages/block-library/src/navigation/edit/inner-blocks.js @@ -101,7 +101,9 @@ export default function NavigationInnerBlocks( { const innerBlocksProps = useInnerBlocksProps( { className: 'wp-block-navigation__container', - style: { gap: blockGap }, + style: { + gap: blockGap ? blockGap : 'var( --wp--style--block-gap )', + }, }, { value: blocks, diff --git a/packages/block-library/src/navigation/index.php b/packages/block-library/src/navigation/index.php index 15e4482f7b3eb9..8730dbc931143e 100644 --- a/packages/block-library/src/navigation/index.php +++ b/packages/block-library/src/navigation/index.php @@ -472,7 +472,7 @@ function render_block_core_navigation( $attributes, $content, $block ) { $layout_class .= ' no-wrap'; } - $block_gap = isset( $attributes['style']['spacing']['blockGap'] ) ? 'style="gap: ' . $attributes['style']['spacing']['blockGap'] . '"' : ''; + $block_gap = isset( $attributes['style']['spacing']['blockGap'] ) ? 'style="gap: ' . $attributes['style']['spacing']['blockGap'] . '"' : 'style="gap: var( --wp--style--block-gap )"'; $colors = block_core_navigation_build_css_colors( $attributes ); $font_sizes = block_core_navigation_build_css_font_sizes( $attributes );