Skip to content

Commit

Permalink
Revert "Make sure the CSS class id-dark-theme is added to the editor …
Browse files Browse the repository at this point in the history
…iframe body. (#60300)" (#60616)

This reverts commit a4ae813.

Co-authored-by: glendaviesnz <[email protected]>
Co-authored-by: ramonjd <[email protected]>
  • Loading branch information
3 people committed Apr 10, 2024
1 parent bb3cfde commit dfec163
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions packages/block-editor/src/components/iframe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ function Iframe( {
function onLoad() {
const { contentDocument, ownerDocument } = node;
const { documentElement } = contentDocument;
// Get any CSS classes the iframe document body may initially have
// to re-apply them later together with the ones of the main document
// body. This is necessary for some CSS classes for example the
// `is-dark-theme` class added by useDarkThemeBodyClassName.
const initialIframeBodyClasses = Array.from(
contentDocument.body.classList
);
iFrameDocument = contentDocument;

documentElement.classList.add( 'block-editor-iframe__html' );
Expand All @@ -158,15 +151,12 @@ function Iframe( {
// be added in the editor too, which we'll somehow have to get from
// the server in the future (which will run the PHP filters).
setBodyClasses(
Array.from( ownerDocument.body.classList )
.concat( initialIframeBodyClasses )
.filter(
( name ) =>
name.startsWith( 'admin-color-' ) ||
name.startsWith( 'post-type-' ) ||
name === 'wp-embed-responsive' ||
name === 'is-dark-theme'
)
Array.from( ownerDocument.body.classList ).filter(
( name ) =>
name.startsWith( 'admin-color-' ) ||
name.startsWith( 'post-type-' ) ||
name === 'wp-embed-responsive'
)
);

contentDocument.dir = ownerDocument.dir;
Expand Down

0 comments on commit dfec163

Please sign in to comment.