From dcfc7f23ba3a428588b96d3ab4114066e6f6a2d6 Mon Sep 17 00:00:00 2001
From: Andrew Serong <14988353+andrewserong@users.noreply.github.com>
Date: Wed, 23 Oct 2024 16:22:35 +1100
Subject: [PATCH] VisualEditor: Remove wide and full alignment CSS on the root
container
---
packages/editor/src/components/visual-editor/index.js | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/packages/editor/src/components/visual-editor/index.js b/packages/editor/src/components/visual-editor/index.js
index 133057d9f388f1..7ee39c27b4416b 100644
--- a/packages/editor/src/components/visual-editor/index.js
+++ b/packages/editor/src/components/visual-editor/index.js
@@ -272,7 +272,7 @@ function VisualEditor( {
'is-layout-flow': ! themeSupportsLayout,
},
themeSupportsLayout && postContentLayoutClasses,
- align && `align${ align }`
+ align && ! [ 'wide', 'full' ].includes( align ) && `align${ align }`
);
const postContentLayoutStyles = useLayoutStyles(
@@ -317,12 +317,6 @@ function VisualEditor( {
titleRef?.current?.focus();
}, [ autoFocus, isCleanNewPost ] );
- // Add some styles for alignwide/alignfull Post Content and its children.
- const alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}
- .is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}
- .is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}
- .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
-
const localRef = useRef();
const typewriterRef = useTypewriter();
contentRef = useMergeRefs( [
@@ -411,7 +405,6 @@ function VisualEditor( {
selector=".block-editor-block-list__layout.is-root-container"
layout={ postEditorLayout }
/>
- { align && }
{ postContentLayoutStyles && (