-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Site Editor: Remove styles reset as script dependency #33522
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
Conversation
6bfc13a to
ca5916c
Compare
|
Hmmm...I had trouble getting this working to test. Whenever I activate the |
jeyip
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of the patch here as well?
gutenberg/packages/block-editor/src/components/iframe/index.js
Lines 58 to 63 in 17898a2
| // 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; | |
| } |
|
I think @ellatrix has an alternative PR for this. Basically, that dependency need to be removed whenever the editor is rendered in an iframe because the "reset" is only needed to reset WP-Admin styles in the editor canvas, and since iframe styles are sandboxes, that's not needed. |
ca5916c to
6aa0d70
Compare
@jeyip We probably could, though I left it alone thinking it would be good to keep as a fallback, in case |
|
FYI I've updated the PR description to explain the reason for this change a little better (mainly better compatibility with asset concatenation plugins). |
|
Are the |
1cdfd4e to
183004b
Compare
TestingRequirements
Browsers
Notes
|
|
Friendly ping @ellatrix. Curious if you have further thoughts on this approach. |
If I read the code correctly, the dependency is only removed from the site editor and not from the template editor (page editor => and then edit the template). This template editor is also iframed. Additionally all previews will be iframed soon for the post editor, and at some point the post editor itself. |
b780177 to
6879c32
Compare
|
@ellatrix Thanks for the feedback! I've modified the PR to keep asset loading as is for the Template editor, but additionally remove I don't see a way to do the same dependency manipulation for the Template editor because of how it's loaded dynamically inside the Post editor... but I'd anticipate this will eventually resolve itself if/when the Post editor is iframed. |

Description
Prevent loading the editor styles reset in the Site Editor.
Related to #33204. Removes the reset from
wp-edit-blocksdependencies when the site editor loads, for better compatibility with asset concatenation plugins (for example, https://wordpress.org/plugins/page-optimize/).Fixes a problem when some Global styles settings do not appear to work in the editor with such plugins because
wp-reset-editor-stylesis concatenated and and then loaded in the Site Editor iframe with along with all concatenated scripts.How has this been tested?
wp-reset-editor-stylesis not loaded, by searching the page markup for the stylesheet id (wp-reset-editor-styles-css) and/or checking to make sure the styles are not applied to.editor-styles-wrapperwithin the iframeScreenshots
Types of changes
Update to existing feature
Checklist:
*.native.jsfiles for terms that need renaming or removal).