Skip to content

Commit

Permalink
Only add the block gap inline style if block gap style is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Glen Davies authored and ramonjd committed Jan 4, 2022
1 parent 392a575 commit 8ef4efc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,10 @@ 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'] . '"' : 'style="gap: var( --wp--style--block-gap )"';
$block_gap = '';
if ( wp_get_global_settings( array( '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 8ef4efc

Please sign in to comment.