From 6adbdfcd1ec8b9314260e4112b3c7df65bfe6e46 Mon Sep 17 00:00:00 2001 From: "Stephen A. Bernhardt" Date: Wed, 5 Jun 2024 18:14:45 -0500 Subject: [PATCH] Add `html` to reset styles on the `editor-styles-wrapper` container Also removes comment about not needing it within an iframe. --- packages/block-library/src/reset.scss | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/block-library/src/reset.scss b/packages/block-library/src/reset.scss index cf5e5a1596df5..df25b2c96e387 100644 --- a/packages/block-library/src/reset.scss +++ b/packages/block-library/src/reset.scss @@ -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;