Skip to content

Commit

Permalink
Remove margins of root container for classic themes to prevent vertic…
Browse files Browse the repository at this point in the history
…al expanding and horizontal scrollbars
  • Loading branch information
ixkaito committed Feb 5, 2022
1 parent 5ad99f5 commit e48e5ce
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/edit-post/src/classic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ html :where(.editor-styles-wrapper) {
}
}

.block-editor-block-preview__content-iframe {
.block-editor-block-list__layout.is-root-container > .wp-block {
// Prevent full-height blocks expanding height endlessly in pattern preview.
margin-top: 0;
margin-bottom: 0;

// Remove the compensating margin of full-wide blocks in pattern preview to prevent horizontal scrollbars.
&[data-align="full"] {
margin-left: 0;
margin-right: 0;
}
}
}

// Deprecated style needed for the block widths and alignments.
// for themes that don't support the new layout (theme.json).
html :where(.wp-block) {
Expand Down

0 comments on commit e48e5ce

Please sign in to comment.