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 <14988353+andrewserong@users.noreply.github.com>
Co-authored-by: stokesman <presstoke@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: ramonjd <ramonopoly@git.wordpress.org>
Co-authored-by: t-hamano <wildworks@git.wordpress.org>
  • Loading branch information
6 people authored and gutenbergplugin committed Oct 25, 2024
1 parent 154ceb5 commit 1e39ceb
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 @@ -367,7 +367,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 1e39ceb

Please sign in to comment.