-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Site Editor: remove content styles outside canvas #66432
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@@ -410,7 +410,7 @@ function gutenberg_register_packages_styles( $styles ) { | |||
$styles, | |||
'wp-edit-site', | |||
gutenberg_url( 'build/edit-site/style.css' ), | |||
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'wp-edit-blocks', 'wp-commands', 'wp-preferences' ), | |||
array( 'wp-components', 'wp-block-editor', 'wp-editor', 'common', 'forms', 'wp-commands', 'wp-preferences' ), |
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.
Do you know why edit-blocks needs common and forms?
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.
Inside the canvas it's currently needed for placeholders (another reason to do the shadow DOM finally).
Outside the canvas we depend on it for all UI. Which is a bit surprising because I'd expect the components package to handle everything.
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.
Inside the canvas it's currently needed for placeholders (another reason to do the shadow DOM finally).
Same for me inside the canvas. I expect components to handle everything, so I wonder why we need it there at all. Maybe we don't need it either and it just there for historic reasons?
I got here from a That bisect was done on trunk after #66556 landed so that didn’t restore it. I haven’t dug in to pinpoint what affected this but I hope someone here might have a clue. I also tested WP 6.7 RC2 on playground and wasn’t seeing this issue so I think the wp/6.7 branch should be okay. |
@stokesman Thank you, I can reproduce! I'll check what's causing it. |
@stokesman Fixed in #66630. The cause is a misplaced CSS rule. |
What?
In the Site Editor, we always load the content in an iframe, so it's not necessary to load the content styles outside the canvas.
Why?
Unnecessary styles loading.
How?
We can remove
wp-edit-blocks
. There was an implicit dependency oncommon
andforms
that I've now made explicit.Testing Instructions
Sanity check styles in the Site Editor.
Testing Instructions for Keyboard
Screenshots or screencast