Repository navigation
Layout: Ensure defaultEditorStyles are still output in Classic themes - #42906
Merged
andrewserong merged 1 commit intoAug 3, 2022
Merged
Conversation
…e provides no editor styles and base layout styles are output
10 of 30 tasks
Contributor
Author
|
@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) |
Member
|
@andrewserong, thanks for the ping. I've one more item to cherry-pick for today's release and this seems essential enough 👍 |
Contributor
Author
|
Excellent, thank you again! 🙇 |
glendaviesnz
approved these changes
Aug 3, 2022
Contributor
|
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 |
Member
Contributor
Author
|
Thanks for reviewing and testing, folks! I'll merge this in now. |
andrewserong
deleted the
fix/default-editor-styles-rendering-in-classic-themes
branch
August 3, 2022 05:03
Mamaduka
pushed a commit
that referenced
this pull request
Aug 3, 2022
…e provides no editor styles and base layout styles are output (#42906)
27 of 37 tasks
3 of 6 tasks
saulirajala
added a commit
to saulirajala/gutenberg
that referenced
this pull request
Jul 2, 2026
…ditor settings Restores default editor styles for themes without theme.json. The editor skips default-editor-styles.css whenever a 'theme'-typed styles entry is present, and WordPress#73971 started typing the generated global stylesheet as 'theme' for all themes, leaving classic-theme editor content unstyled (browser default serif). Reintroduces the guard from WordPress#42906 as a condition and adds a regression test for both theme types. Fixes WordPress#79815.
saulirajala
added a commit
to saulirajala/gutenberg
that referenced
this pull request
Jul 2, 2026
…ditor settings Restores default editor styles for themes without theme.json. The editor skips default-editor-styles.css whenever a 'theme'-typed styles entry is present, and WordPress#73971 started typing the generated global stylesheet as 'theme' for all themes, leaving classic-theme editor content unstyled (browser default serif). Reintroduces the guard from WordPress#42906 as a condition. Fixes WordPress#79815.
ramonjd
pushed a commit
to saulirajala/gutenberg
that referenced
this pull request
Sep 15, 2026
…ditor settings Restores default editor styles for themes without theme.json. The editor skips default-editor-styles.css whenever a 'theme'-typed styles entry is present, and WordPress#73971 started typing the generated global stylesheet as 'theme' for all themes, leaving classic-theme editor content unstyled (browser default serif). Reintroduces the guard from WordPress#42906 as a condition. Fixes WordPress#79815.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What?
Fixes #42902
When outputting base layout styles in a theme that otherwise does not output theme global styles, ensure the
typeof the base layout styles is not set tothemeso 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
__unstableTypeso 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