Skip to content

Commit

Permalink
Move to block canvas styles in the visual editor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewserong committed Oct 24, 2024
1 parent ead511a commit f4eaee5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 0 additions & 4 deletions packages/block-editor/src/components/iframe/content.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
.block-editor-iframe__body {
position: relative;
// 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.
display: flow-root;
}

.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 f4eaee5

Please sign in to comment.