Skip to content

Commit

Permalink
Provide a white background color. (#32767)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen authored Jun 21, 2021
1 parent ff385f6 commit d449b7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 5 additions & 0 deletions packages/block-library/src/reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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"] {
Expand Down
2 changes: 1 addition & 1 deletion packages/edit-post/src/components/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 1 addition & 3 deletions packages/edit-post/src/components/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit d449b7b

Please sign in to comment.