-
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
Add default editor styles applied to themes without theme.json and without editor styles #34439
Conversation
|
||
p { | ||
line-height: 2; | ||
} |
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.
@jasmussen this is the styles file if you want to tweak it.
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.
I've got a related PR at #34334 that enqueues the global styles for all themes. After it lands, shouldn't these styles live at lib/theme.json
?
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.
I don't know, what I know is that they need to be in a dedicated setting in order for this logic to apply https://github.com/WordPress/gutenberg/pull/34439/files#diff-d00cfe048041886ee9b16f6f42422317b6e770cbea20cbe0e4d0ca7c8e0ec0e1R159-R161
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.
hey, so since #35424 all themes provide some styles
to settings: at least they'll have the core preset styles. That inadvertently cause a bug for themes that don't provide any editor styles: they no longer had any defaults. See issue at #35730
I've created a fix for this at #35736 but I'm not convinced is the right approach. So I've prepared a second fix to absorb the defaults as part of the styles we send to the client in global-styles.php
, see #35737
I'd love hearing your thoughts on which approach makes more sense to you.
Size Change: +153 B (0%) Total Size: 1.04 MB
ℹ️ View Unchanged
|
This is excellent. I'll see what polish we need to push for this one, it might be good to start simple and take it from there. That said, I'm seeing these styles loaded regardless of settings in both my own block theme and in TT1 blocks: I have "use theme styles" applied, still seeing these instead. |
@jasmussen it should be better now :) Thanks for catching that. |
Alright, I pushed some styles:
Since these styles are shown only if you explicitly choose to show them, and for very old themes, there's no reason not to make it nice and easy to read. What do you think? |
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.
Left one minor comment. Aside from that, this feels really nice and simple. I tested in a few different themes, and it works when it's supposed to. 👍
It would be nice to bundle this into a WP point release so folks don't have to wait until 5.9 to experience it. The current experience feels like a regression to me, so I think there's some good reason to push it in early.
Co-authored-by: Kjell Reigstad <kjell.reigstad@automattic.com>
🔥 |
I added the ""Backport to WP Minor Release" based on @kjellr 's comment:
|
My original issue #31211, which was the 2nd generation of this issue specifically called out a line-height problem. The old default of I also noticed that the Gutenberg style problem made its way into the core. In the past, deactivating the plugin fixed it. Today, enabling the plugin fixes it. Much appreciated. I am going to close my issue. |
closes #34397
This PR adds some default editor styles for themes that don't style the editor at all:
They also apply to all themes when you uncheck "use theme styles" in the preferences.
Testing instructions
Check with a variety of themes: