mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@57490 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user