Skip to content

Commit

Permalink
Move wp-block-library-theme inside current_theme_supports logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Dec 16, 2022
1 parent 9e5bece commit 89c3d7d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,15 @@ function gutenberg_register_packages_styles( $styles ) {
global $editor_styles;
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';

gutenberg_override_style(
$styles,
'wp-block-library-theme',
gutenberg_url( 'build/block-library/theme.css' ),
array(),
$version
);
$styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );
}

gutenberg_override_style(
Expand Down Expand Up @@ -367,15 +375,6 @@ function gutenberg_register_packages_styles( $styles ) {
);
$styles->add_data( 'wp-edit-blocks', 'rtl', 'replace' );

gutenberg_override_style(
$styles,
'wp-block-library-theme',
gutenberg_url( 'build/block-library/theme.css' ),
array(),
$version
);
$styles->add_data( 'wp-block-library-theme', 'rtl', 'replace' );

gutenberg_override_style(
$styles,
'wp-list-reusable-blocks',
Expand Down

1 comment on commit 89c3d7d

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/3714967681
📝 Reported issues:

Please sign in to comment.