Skip to content

Commit

Permalink
Fallback to theme default block gap setting if not explicitly set on …
Browse files Browse the repository at this point in the history
…block
  • Loading branch information
Glen Davies authored and ramonjd committed Jan 4, 2022
1 parent d7f47ca commit 392a575
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/block-library/src/navigation/edit/inner-blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 392a575

Please sign in to comment.