Editor: reduce specificity of block style variation selector.

Removes duplicate classname from the block style variation selector generated in `WP_Theme_JSON`’s `get_blocks_metadata` function.

Props flixos90, joemcgill, mukesh27, isabel_brison.
Fixes #60312.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56991 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
isabel_brison 2024-01-30 23:51:15 +00:00
parent 53fd556c73
commit 04eb7ecf30
2 changed files with 2 additions and 3 deletions

View File

@ -947,8 +947,7 @@ class WP_Theme_JSON {
if ( ! empty( $block_type->styles ) ) {
$style_selectors = array();
foreach ( $block_type->styles as $style ) {
// The style variation classname is duplicated in the selector to ensure that it overrides core block styles.
$style_selectors[ $style['name'] ] = static::append_to_selector( '.is-style-' . $style['name'] . '.is-style-' . $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
$style_selectors[ $style['name'] ] = static::append_to_selector( '.is-style-' . $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
}
static::$blocks_metadata[ $block_name ]['styleVariations'] = $style_selectors;
}

View File

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