Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix layout shift on zoom out in post/page editor. #65915

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/block-editor/src/components/iframe/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, it isn't clear to me that these are the best places to add these pieces of code, I'm happy to move it if you have suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think .block-editor-iframe__body can stay in this file, but
.editor-visual-editor__post-title-wrapper is part of the editor package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good feedback, thank you. I can move this (especially if you have a recommendation) some time tomorrow. If you happen to have the branch checked out and want to push the changes directly, feel free to!

.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;
Expand Down
Loading