From e48e5ce2f3799b9a892608993dd279ddab9e722f Mon Sep 17 00:00:00 2001 From: Kite Date: Sat, 5 Feb 2022 19:52:44 +0900 Subject: [PATCH] Remove margins of root container for classic themes to prevent vertical expanding and horizontal scrollbars --- packages/edit-post/src/classic.scss | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/edit-post/src/classic.scss b/packages/edit-post/src/classic.scss index 8cba8020e0b912..132e4603959f74 100644 --- a/packages/edit-post/src/classic.scss +++ b/packages/edit-post/src/classic.scss @@ -18,6 +18,20 @@ html :where(.editor-styles-wrapper) { } } +.block-editor-block-preview__content-iframe { + .block-editor-block-list__layout.is-root-container > .wp-block { + // Prevent full-height blocks expanding height endlessly in pattern preview. + margin-top: 0; + margin-bottom: 0; + + // Remove the compensating margin of full-wide blocks in pattern preview to prevent horizontal scrollbars. + &[data-align="full"] { + margin-left: 0; + margin-right: 0; + } + } +} + // Deprecated style needed for the block widths and alignments. // for themes that don't support the new layout (theme.json). html :where(.wp-block) {