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

Only include theme.css if the theme declares support for wp-block-styles #44640

Merged
merged 4 commits into from
Oct 10, 2022
Merged
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
4 changes: 2 additions & 2 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ function gutenberg_register_packages_styles( $styles ) {
}

global $editor_styles;
if ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) {
// Include opinionated block styles if no $editor_styles are declared, so the editor never appears broken.
if ( current_theme_supports( 'wp-block-styles' ) && ( ! is_array( $editor_styles ) || count( $editor_styles ) === 0 ) ) {
// Include opinionated block styles if the theme supports block styles and no $editor_styles are declared, so the editor never appears broken.
$wp_edit_blocks_dependencies[] = 'wp-block-library-theme';
}

Expand Down