Skip to content

Commit

Permalink
Add html to reset styles on the editor-styles-wrapper container (#…
Browse files Browse the repository at this point in the history
…62350)

Also removes comment about not needing it within an iframe.

Unlinked contributors: peXed.

Co-authored-by: sabernhardt <sabernhardt@git.wordpress.org>
Co-authored-by: ellatrix <ellatrix@git.wordpress.org>
Co-authored-by: karmatosed <karmatosed@git.wordpress.org>
  • Loading branch information
4 people committed Jun 25, 2024
1 parent 64c3b8e commit b9636e6
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions packages/block-library/src/reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@
// We use :where to keep specificity minimal.
// https://css-tricks.com/almanac/selectors/w/where/
:where(.editor-styles-wrapper) {
/**
* The following styles revert to the browser defaults overriding the WPAdmin styles.
* This is only needed while the block editor is not being loaded in an iframe.
*/
font-family: serif; // unfortunately initial doesn't work for font-family.
font-size: initial;
line-height: initial;
color: initial;
// The following styles revert to the browser defaults overriding the WPAdmin styles.
html & {
font-family: serif; // unfortunately initial doesn't work for font-family.
font-size: initial;
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;
// 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;
}

.wp-align-wrapper {
max-width: $content-width;
Expand Down

0 comments on commit b9636e6

Please sign in to comment.