Skip to content

Commit

Permalink
Reduce specificity of block style variation selector.
Browse files Browse the repository at this point in the history
  • Loading branch information
tellthemachines committed Jan 21, 2024
1 parent 4a2eb5c commit d7bbbba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,7 @@ protected static function get_blocks_metadata() {
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;
}
Expand Down

0 comments on commit d7bbbba

Please sign in to comment.