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.

Built from https://develop.svn.wordpress.org/trunk@59793


git-svn-id: http://core.svn.wordpress.org/trunk@59135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Peter Wilson 2025-02-09 22:34:23 +00:00
parent 770eb818a4
commit c101e1b5b2
2 changed files with 5 additions and 6 deletions

View File

@ -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',

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.8-alpha-59792';
$wp_version = '6.8-alpha-59793';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.