Skip to content

Commit

Permalink
VisualEditor: Remove wide and full alignment CSS on the root container
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Oct 24, 2024
1 parent 5437114 commit dcfc7f2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions packages/editor/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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( [
Expand Down Expand Up @@ -411,7 +405,6 @@ function VisualEditor( {
selector=".block-editor-block-list__layout.is-root-container"
layout={ postEditorLayout }
/>
{ align && <LayoutStyle css={ alignCSS } /> }
{ postContentLayoutStyles && (
<LayoutStyle
layout={ postContentLayout }
Expand Down

0 comments on commit dcfc7f2

Please sign in to comment.