From 67bc44b3118bbb7cd06273233bbbe18a74383a06 Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Sun, 9 Feb 2025 22:32:50 +0000 Subject: [PATCH] Editor: Update enqueued styles in the editor. Updates the enqueued styles in various editors to remove target styles more precisely to where they are needed. Removes the following stylesheets as dependencies of `wp-edit-blocks`: * `wp-editor` * `wp-reusable-blocks` * `wp-patterns` The `wp-editor` stylesheet is targeted to the items requiring the CSS: * `edit-widgets` * `customize-widgets` * `edit-site` Props ellatrix, youknowriad. Fixes #62266, #62274. git-svn-id: https://develop.svn.wordpress.org/trunk@59793 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/script-loader.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index aceeffcdc99af..5aa991972477c 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -1680,18 +1680,16 @@ function wp_default_styles( $styles ) { array( 'wp-components' ) ); + // Only add CONTENT styles here that should be enqueued in the iframe! $wp_edit_blocks_dependencies = array( 'wp-components', - 'wp-editor', /* * This needs to be added before the block library styles, * The block library styles override the "reset" styles. */ 'wp-reset-editor-styles', 'wp-block-library', - 'wp-reusable-blocks', 'wp-block-editor-content', - 'wp-patterns', ); // Only load the default layout and margin styles for themes without theme.json file. @@ -1750,24 +1748,25 @@ function wp_default_styles( $styles ) { 'edit-widgets' => array( 'wp-widgets', 'wp-block-editor', + 'wp-editor', 'wp-edit-blocks', 'wp-block-library', - 'wp-reusable-blocks', 'wp-patterns', 'wp-preferences', ), 'customize-widgets' => array( 'wp-widgets', 'wp-block-editor', + 'wp-editor', 'wp-edit-blocks', 'wp-block-library', - 'wp-reusable-blocks', 'wp-patterns', 'wp-preferences', ), 'edit-site' => array( 'wp-components', 'wp-block-editor', + 'wp-editor', 'wp-edit-blocks', 'wp-commands', 'wp-preferences',