diff --git a/lib/client-assets.php b/lib/client-assets.php index 0f9704cb39fc4c..fa1832d2f23729 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -745,7 +745,8 @@ function gutenberg_extend_block_editor_styles_html() { ob_start(); - wp_styles()->done = array(); + // We do not need reset styles for the iframed editor. + wp_styles()->done = array( 'wp-reset-editor-styles' ); wp_styles()->do_items( $style_handles ); wp_styles()->done = $done; diff --git a/packages/block-editor/src/components/iframe/index.js b/packages/block-editor/src/components/iframe/index.js index d089925b3846aa..ebcab57b1173fd 100644 --- a/packages/block-editor/src/components/iframe/index.js +++ b/packages/block-editor/src/components/iframe/index.js @@ -49,6 +49,13 @@ function styleSheetsCompat( doc ) { return; } + // Don't try to add the reset styles, which were removed as a dependency + // from `edit-blocks` for the iframe since we don't need to reset admin + // styles. + if ( ownerNode.id === 'wp-reset-editor-styles-css' ) { + return; + } + const isMatch = Array.from( cssRules ).find( ( { selectorText } ) => selectorText &&