-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.editor-styles-wrapper
prefix remains on device previews
#59852
Comments
Actually, after further testing, this seems to affect block themes as well if they have a classic metabox on the page. To reproduce:
And you'll see this CSS when previewing a device:
However, in WP 6.5-RC2, you see the |
Tagging @ellatrix here for visibility |
I think the crux of the issue here is that in block themes / iframed previews the selectors are no longer getting scoped to the editor styles wrapper. The scoping is only supposed to happen when the content area is not rendered in an iFrame. And the device previews are always rendered inside the iFrame. |
Yeah, in 6.4 the |
Does #56649 fix your problem? |
@ellatrix Hey thanks for following up on this! Looks like the selector in the scope prop is a bit too specific, I made a comment with a suggested change on the PR for you: https://github.com/WordPress/gutenberg/pull/56649/files#r1546874525 |
Description
When adding a stylesheet via
add_editor_style()
in a classic theme, the.editor-styles-wrapper
prefix that is automatically added when no device preview is selected remains when a device is selected.However, if you add CSS via
block_editor_settings_all
, the prefix is removed. This leads to specificity issues.Before WP 6.5, this prefix was removed when previewing a device.
Step-by-step reproduction instructions
add_editor_style()
.editor-styles-wrapper
prefix.This was not the case in WP 6.4.x.
Easiest way to see this is to use the Twenty-Twenty-Two theme and add an ACF metabox.
Environment info
WP 6.5-RC2
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: