Skip to content

Commit

Permalink
This PR ensures that the iframe background is always white regardless…
Browse files Browse the repository at this point in the history
… of whether it has "padding". Because the background of the visual editor is $gray-900, we use a border to mimic existing padding.
  • Loading branch information
ramonjd committed Feb 1, 2024
1 parent b718580 commit 44bc6ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/block-editor/src/components/block-canvas/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ iframe[name="editor-canvas"] {
width: 100%;
height: 100%;
display: block;
}

iframe[name="editor-canvas"]:not(.has-editor-padding) {
background-color: $white;
}

iframe[name="editor-canvas"].has-editor-padding {
padding: $grid-unit-60 $grid-unit-60 0;
border-width: $grid-unit-60 $grid-unit-60 0;
border-style: solid;
border-color: $gray-900; // Matches .edit-post-visual-editor and .edit-site-visual-editor backgrounds.
}
1 change: 1 addition & 0 deletions packages/editor/src/components/editor-canvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ function EditorCanvas( {
style: {
...iframeProps?.style,
...deviceStyles,
border: showEditorPadding ? undefined : 0,
},
} }
>
Expand Down

0 comments on commit 44bc6ee

Please sign in to comment.