Skip to content

Commit

Permalink
Only include theme.css if the theme declares support for wp-block-sty…
Browse files Browse the repository at this point in the history
…les (#44640)

* Update client-assets.php

* Update client-assets.php

* Update client-assets.php

* Update lib/client-assets.php

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>

Co-authored-by: Ari Stathopoulos <aristath@gmail.com>
  • Loading branch information
2 people authored and ockham committed Oct 10, 2022
1 parent 6275923 commit 55d9f55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,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

0 comments on commit 55d9f55

Please sign in to comment.