diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index e01a3c60ce927a..92f28ba6950a51 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -53,7 +53,7 @@ function gutenberg_get_layout_style( $selector, $layout, $has_block_gap_support $style = ''; if ( $content_size || $wide_size ) { - $style = "$selector > :not(.alignleft):not(.alignright) {"; + $style = "$selector > :where(:not(.alignleft):not(.alignright)) {"; $style .= 'max-width: ' . esc_html( $all_max_width_value ) . ';'; $style .= 'margin-left: auto !important;'; $style .= 'margin-right: auto !important;'; diff --git a/packages/block-editor/src/layouts/flow.js b/packages/block-editor/src/layouts/flow.js index f5581534fa7995..ae2e9379bdf110 100644 --- a/packages/block-editor/src/layouts/flow.js +++ b/packages/block-editor/src/layouts/flow.js @@ -115,7 +115,10 @@ export default { let output = !! contentSize || !! wideSize ? ` - ${ appendSelectors( selector, '> :not(.alignleft):not(.alignright)' ) } { + ${ appendSelectors( + selector, + '> :where(:not(.alignleft):not(.alignright))' + ) } { max-width: ${ contentSize ?? wideSize }; margin-left: auto !important; margin-right: auto !important;