From ca8a108c50488a1bfab12358ba486a6c14e1c52f Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 25 Mar 2024 16:46:43 +1100 Subject: [PATCH 1/2] Fix horizontal flex layout in classic themes. --- packages/edit-post/src/classic.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/edit-post/src/classic.scss b/packages/edit-post/src/classic.scss index 8cba8020e0b91..b85beccd74ca1 100644 --- a/packages/edit-post/src/classic.scss +++ b/packages/edit-post/src/classic.scss @@ -1,7 +1,8 @@ // Provide baseline auto margin for centering blocks. // Specificity is kept at this level as many classic themes output // rules like figure { margin: 0; } which would break centering. -.editor-styles-wrapper .wp-block { +// These rules should also not apply to direct children of flex layout blocks. +:where(.editor-styles-wrapper) :where(:not(.is-layout-flex)) > .wp-block { margin-left: auto; margin-right: auto; } From de9df94651c60b2695aa7513f03175da9905cee8 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Tue, 26 Mar 2024 11:34:15 +1100 Subject: [PATCH 2/2] Exclude grid children from being targeted. --- packages/edit-post/src/classic.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/edit-post/src/classic.scss b/packages/edit-post/src/classic.scss index b85beccd74ca1..5e1f2b8335d97 100644 --- a/packages/edit-post/src/classic.scss +++ b/packages/edit-post/src/classic.scss @@ -2,7 +2,7 @@ // Specificity is kept at this level as many classic themes output // rules like figure { margin: 0; } which would break centering. // These rules should also not apply to direct children of flex layout blocks. -:where(.editor-styles-wrapper) :where(:not(.is-layout-flex)) > .wp-block { +:where(.editor-styles-wrapper) :where(:not(.is-layout-flex, .is-layout-grid)) > .wp-block { margin-left: auto; margin-right: auto; }