From d449b7be08de44e80215e681ae50ce7b86428896 Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Mon, 21 Jun 2021 13:10:36 +0200 Subject: [PATCH] Provide a white background color. (#32767) --- packages/block-library/src/reset.scss | 5 +++++ packages/edit-post/src/components/visual-editor/index.js | 2 +- packages/edit-post/src/components/visual-editor/style.scss | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/reset.scss b/packages/block-library/src/reset.scss index 8e9894f81b14f..deaa6774abcc9 100644 --- a/packages/block-library/src/reset.scss +++ b/packages/block-library/src/reset.scss @@ -17,6 +17,11 @@ line-height: initial; color: initial; + // Many themes with white backgrounds load editor styles but fail to also provide + // an explicit white background color, assuming a white editing canvas. + // So to match browser defaults, we provide a white default here as well. + background: #fff; + // For full-wide blocks, we compensate for the base padding. // These margins should match the padding value above. .block-editor-block-list__layout.is-root-container > .wp-block[data-align="full"] { diff --git a/packages/edit-post/src/components/visual-editor/index.js b/packages/edit-post/src/components/visual-editor/index.js index 9e7fab084bade..c8f6898ffaed7 100644 --- a/packages/edit-post/src/components/visual-editor/index.js +++ b/packages/edit-post/src/components/visual-editor/index.js @@ -119,7 +119,7 @@ export default function VisualEditor( { styles } ) { const { clearSelectedBlock } = useDispatch( blockEditorStore ); const { setIsEditingTemplate } = useDispatch( editPostStore ); const desktopCanvasStyles = { - minHeight: '100%', + height: '100%', width: '100%', margin: 0, display: 'flex', diff --git a/packages/edit-post/src/components/visual-editor/style.scss b/packages/edit-post/src/components/visual-editor/style.scss index 207388691d25d..0d0e982642979 100644 --- a/packages/edit-post/src/components/visual-editor/style.scss +++ b/packages/edit-post/src/components/visual-editor/style.scss @@ -61,9 +61,7 @@ .edit-post-visual-editor__content-area { width: 100%; - // If this is set to height: 100%; it breaks in Safari 13, which calculates the height relatively to the incorrect flex container. - // By setting it as a min-height instead, it appears to work in all cases. - min-height: 100%; + height: 100%; position: relative; display: flex; }