Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
try omitting flex + fullwidth from global padding
  • Loading branch information
richtabor authored and tellthemachines committed May 28, 2024
commit d57a0226c0a2d662dec3b117ef502cb984353e0c
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