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 and swissspidy committed Oct 25, 2024
1 parent 8f99999 commit a198bd2
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

0 comments on commit a198bd2

Please sign in to comment.