Skip to content
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

StyleBook: Make available in all classic themes #67782

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/compat/wordpress-6.8/site-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function gutenberg_styles_wp_die_handler( $default_handler ) {
* @global array $submenu
*/
function gutenberg_add_styles_submenu_item() {
if ( ! wp_is_block_theme() && ( current_theme_supports( 'editor-styles' ) || wp_theme_has_theme_json() ) ) {
if ( ! wp_is_block_theme() ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave @tellthemachines to chime in with a more educated review, but I was just wondering what the implication of this comment from #66851 (comment) would be:

because if the theme has neither, the style book will be useless.

Does these mean if a theme doesn't have editor or theme.json styles, the style book would just render the default styles?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does these mean if a theme doesn't have editor or theme.json styles, the style book would just render the default styles?

That's what I thought at first too. But as mentioned in this PR, it seems there's a way to apply styles for blocks on the editor side other than theme.json or editor-styles support.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced we should do this, as having a condition means themes have the choice to opt in or out. If themes really want the stylebook, it costs nothing to add theme support for editor-styles. Twenty Twenty has it even though it enqueues its editor styles via enqueue_block_assets as in your example.

global $submenu;

$styles_menu_item = array(
Expand Down
Loading