-
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
Layout: Ensure defaultEditorStyles are still output in Classic themes #42906
Layout: Ensure defaultEditorStyles are still output in Classic themes #42906
Conversation
…e provides no editor styles and base layout styles are output
@Mamaduka I know we're very close to the 13.8 release time, but I was wondering if it's worth trying to get this PR cherry picked in, too, in order to fix this editor styling regression for some Classic themes? (If the approach here looks okay) |
@andrewserong, thanks for the ping. I've one more item to cherry-pick for today's release and this seems essential enough 👍 |
Excellent, thank you again! 🙇 |
Tested well for me on Dara, and also tested a few different block and non-block themes and the editor fonts were the same between 13.6 and this branch. Would probably be good to get some more testing from someone else as well though if we have time before getting it picked into 13.8 |
Thanks for reviewing and testing, folks! I'll merge this in now. |
…e provides no editor styles and base layout styles are output (#42906)
What?
Fixes #42902
When outputting base layout styles in a theme that otherwise does not output theme global styles, ensure the
type
of the base layout styles is not set totheme
so that it isn't considered as theme styles by the check ingutenberg/packages/edit-post/src/editor.js
Line 178 in 9f0e6be
Why?
As of #40875, base layout styles are output as part of the Theme JSON class — in order to support Classic themes using the default editor styles, we need to ensure that the base layout styles are not considered "theme" styles by the above check. Otherwise themes that do not provide their own editor styles will not have default editor styles to ensure elements in the editor look pleasing.
How?
When outputting base layout styles for Classic themes, use a different
__unstableType
so that it isn't treated as theme styles. These styles get appended into the presets styles as part of the following line, which is the desired behaviour:gutenberg/packages/edit-post/src/editor.js
Line 174 in 9f0e6be
Testing Instructions
Screenshots or screencast
With Dara theme applied