Skip to content

Commit

Permalink
try omitting flex + fullwidth from global padding
Browse files Browse the repository at this point in the history
  • Loading branch information
richtabor committed May 23, 2024
1 parent 6b212b7 commit 5e3f48e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/block-supports/layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
3 changes: 2 additions & 1 deletion packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit 5e3f48e

Please sign in to comment.