diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index b73dc13b50c73e..889c17ced25b78 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -737,7 +737,7 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) { $root_padding_aware_alignments = $global_settings['useRootPaddingAwareAlignments'] ?? false; - if ( $root_padding_aware_alignments && isset( $used_layout['type'] ) && 'constrained' === $used_layout['type'] || 'full' === $used_alignment ) { + if ( $root_padding_aware_alignments && isset( $used_layout['type'] ) && 'constrained' === $used_layout['type'] || ( 'full' === $used_alignment && ! 'flex' === $used_layout['type'] ) ) { $class_names[] = 'has-global-padding'; } diff --git a/packages/block-editor/src/hooks/layout.js b/packages/block-editor/src/hooks/layout.js index 66f92b3347c590..bef48d769e6a73 100644 --- a/packages/block-editor/src/hooks/layout.js +++ b/packages/block-editor/src/hooks/layout.js @@ -78,7 +78,8 @@ export function useLayoutClasses( blockAttributes = {}, blockName = '' ) { ( usedLayout?.inherit || usedLayout?.contentSize || usedLayout?.type === 'constrained' || - blockAttributes?.align === 'full' ) && + ( blockAttributes?.align === 'full' && + usedLayout?.type !== 'flex' ) ) && select( blockEditorStore ).getSettings().__experimentalFeatures ?.useRootPaddingAwareAlignments );