From 16a72d6c583c1d5322ebe46ad360a18b723e1ac6 Mon Sep 17 00:00:00 2001 From: jasmussen Date: Mon, 7 Oct 2024 15:06:46 +0200 Subject: [PATCH] Fix layout shift on zoom out in post/page editor. --- packages/block-editor/src/components/iframe/content.scss | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/block-editor/src/components/iframe/content.scss b/packages/block-editor/src/components/iframe/content.scss index 90b887993bf6db..0e1ec137ae58ec 100644 --- a/packages/block-editor/src/components/iframe/content.scss +++ b/packages/block-editor/src/components/iframe/content.scss @@ -21,6 +21,13 @@ margin-left: calc(-1 * (#{$prev-container-width} - #{$container-width}) / 2); } +// Avoid collapsing margins causing a layout shift when invoking zooming. +.block-editor-iframe__body, +.editor-visual-editor__post-title-wrapper { + border-top: 0.1em solid transparent; + border-bottom: 0.1em solid transparent; +} + .block-editor-iframe__html { border: 0 solid $gray-300; transform-origin: top center;