-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add theme styles in the site editor #29704
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
|
Size Change: +14 B (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
- if the theme has declared support - if the theme doesn't have any editor styles
youknowriad
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.
Makes sense to me
| wp_enqueue_style( 'wp-format-library' ); | ||
|
|
||
| if ( | ||
| current_theme_supports( 'wp-block-styles' ) || |
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.
We have this same condition for loading the styles in the post editor. I wonder if we should refactor that to share the code?
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.
If we do refactor this I see a function in WP_Theme_Config being introduce here #29667
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.
LGTM, just one suggestion for improvement.
It looks like we don't enqueue the theme styles in the site editor, but we do in the widgets and post editors. As a result, there're some things that appear broken, such as that a group block with background color doesn't get padding.
This PR enqueues this stylesheet to the site editor as well.
How to test
The expected result is that the group block gains some padding.