From 11557cc56d6389e958ff00c98103b13151a50d91 Mon Sep 17 00:00:00 2001 From: Jason Crist Date: Tue, 25 May 2021 13:22:20 -0400 Subject: [PATCH] Removed !important from alignment margins. So that exceptions can be coded for blocks and elements inside of a container controlling layout !important was removed from the margin styles being applied. --- lib/block-supports/layout.php | 4 ++-- packages/block-editor/src/components/block-list/layout.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index 1b1eec679c80a0..23ce90a5574e9b 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -65,8 +65,8 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) { if ( $content_size || $wide_size ) { $style = ".wp-container-$id > * {"; $style .= 'max-width: ' . esc_html( $all_max_width_value ) . ';'; - $style .= 'margin-left: auto !important;'; - $style .= 'margin-right: auto !important;'; + $style .= 'margin-left: auto;'; + $style .= 'margin-right: auto;'; $style .= '}'; $style .= ".wp-container-$id > .alignwide { max-width: " . esc_html( $wide_max_width_value ) . ';}'; diff --git a/packages/block-editor/src/components/block-list/layout.js b/packages/block-editor/src/components/block-list/layout.js index e29fb8ab05ccaa..3f898ae12c02fe 100644 --- a/packages/block-editor/src/components/block-list/layout.js +++ b/packages/block-editor/src/components/block-list/layout.js @@ -43,8 +43,8 @@ export function LayoutStyle( { selector, layout = {} } ) { ? ` ${ appendSelectors( selector, '> *' ) } { max-width: ${ contentSize ?? wideSize }; - margin-left: auto !important; - margin-right: auto !important; + margin-left: auto; + margin-right: auto; } ${ appendSelectors( selector, '> [data-align="wide"]' ) } {