From c9f47508e3a3a0e845e0fa27e912633eed67a8c9 Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Wed, 28 Jun 2023 12:46:26 +0200 Subject: [PATCH] Editor initrial appender: Zero out margins in constrained layouts. (#52026) --- .../components/default-block-appender/content.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/block-editor/src/components/default-block-appender/content.scss b/packages/block-editor/src/components/default-block-appender/content.scss index 9eecf9a7e007a..48aac077096c2 100644 --- a/packages/block-editor/src/components/default-block-appender/content.scss +++ b/packages/block-editor/src/components/default-block-appender/content.scss @@ -26,6 +26,17 @@ opacity: 0.62; } + // In "constrained" layout containers, the first and last paragraphs have their margins zeroed out. + // In the case of this appender, it needs to apply those same rules to avoid layout shifts. + // Such shifts happen when the bottom margin of the Title block has been set to less than the default 1em margin of paragraphs. + :where(body .is-layout-constrained) & { + > :first-child:first-child { + margin-block-start: 0; + } + + // Since this particular appender will only ever appear on an entirely empty document, we don't account for last-child. + } + // Dropzone. .components-drop-zone__content-icon { display: none;