diff --git a/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php b/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php index 808268f845b0d..46b39b79b3924 100644 --- a/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php +++ b/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php @@ -370,6 +370,13 @@ protected function get_block_classes( $style_nodes ) { if ( $has_block_gap_support ) { $block_rules .= '.wp-site-blocks > * { margin-block-start: 0; margin-block-end: 0; }'; $block_rules .= '.wp-site-blocks > * + * { margin-block-start: var( --wp--style--block-gap ); }'; + + $block_gap_value = _wp_array_get( $node, array( 'spacing', 'blockGap' ), '0.5em' ); + foreach( static::LAYOUT_STYLES as $key => $layout_style_selectors ) { + foreach( $layout_style_selectors as $layout_selector => $css_property ) { + $block_rules .= "$selector $layout_selector { " . $css_property . ': ' . $block_gap_value . " }"; + } + } } } }