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 committed Dec 22, 2021
1 parent 016fc7f commit 254f368
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 254f368

Please sign in to comment.