Skip to content

Commit

Permalink
Block editor: give iframe fallback background color (#57330)
Browse files Browse the repository at this point in the history
* Extracts block editor iframe styles and adds a default background color.

* Removing duplicate styles that apply to the editor canvas iframe
  • Loading branch information
ramonjd authored Jan 2, 2024
1 parent 60bf21e commit 1b2dac7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
2 changes: 0 additions & 2 deletions packages/block-editor/src/components/block-canvas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ export function ExperimentalBlockCanvas( {
ref={ resetTypingRef }
contentRef={ contentRef }
style={ {
width: '100%',
height: '100%',
...iframeProps?.style,
} }
name="editor-canvas"
Expand Down
6 changes: 6 additions & 0 deletions packages/block-editor/src/components/block-canvas/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
iframe[name="editor-canvas"] {
width: 100%;
height: 100%;
background-color: $white;
display: block;
}
1 change: 1 addition & 0 deletions packages/block-editor/src/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import "./autocompleters/style.scss";
@import "./components/block-alignment-control/style.scss";
@import "./components/block-canvas/style.scss";
@import "./components/block-icon/style.scss";
@import "./components/block-inspector/style.scss";
@import "./components/block-tools/style.scss";
Expand Down
9 changes: 0 additions & 9 deletions packages/edit-site/src/components/block-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,7 @@
// Centralize the editor horizontally (flex-direction is column).
align-items: center;

iframe {
display: block;
width: 100%;
height: 100%;
background: $white;
}

.edit-site-visual-editor__editor-canvas {
height: 100%;

&.is-focused {
outline: calc(2 * var(--wp-admin-border-width-focus)) solid var(--wp-admin-theme-color);
outline-offset: calc(-2 * var(--wp-admin-border-width-focus));
Expand Down

0 comments on commit 1b2dac7

Please sign in to comment.