Skip to content

Commit

Permalink
Revise zoom layout shift fix (#66390)
Browse files Browse the repository at this point in the history
* Contain margins with BFC instead of border

* Move to block canvas styles in the visual editor

---------

Co-authored-by: Andrew Serong <[email protected]>
Co-authored-by: stokesman <[email protected]>
Co-authored-by: andrewserong <[email protected]>
Co-authored-by: ramonjd <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
6 people authored Oct 25, 2024
1 parent 187ef63 commit 268b0fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/block-editor/src/components/iframe/content.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.block-editor-iframe__body {
position: relative;
border: 0.01px solid transparent;
}

.block-editor-iframe__html {
Expand Down
5 changes: 4 additions & 1 deletion packages/editor/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,10 @@ function VisualEditor( {
return [
...( styles ?? [] ),
{
css: `.is-root-container{display:flow-root;${
// Ensures margins of children are contained so that the body background paints behind them.
// Otherwise, the background of html (when zoomed out) would show there and appear broken. It’s
// important mostly for post-only views yet conceivably an issue in templated views too.
css: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${
// Some themes will have `min-height: 100vh` for the root container,
// which isn't a requirement in auto resize mode.
enableResizing ? 'min-height:0!important;' : ''
Expand Down

1 comment on commit 268b0fe

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 268b0fe.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11510829891
📝 Reported issues:

Please sign in to comment.