Make WordPress Core

Changeset 57490


Ignore:
Timestamp:
01/30/2024 11:49:09 PM (4 months ago)
Author:
isabel_brison
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r57352 r57490  
    948948                $style_selectors = array();
    949949                foreach ( $block_type->styles as $style ) {
    950                     // The style variation classname is duplicated in the selector to ensure that it overrides core block styles.
    951                     $style_selectors[ $style['name'] ] = static::append_to_selector( '.is-style-' . $style['name'] . '.is-style-' . $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
     950                    $style_selectors[ $style['name'] ] = static::append_to_selector( '.is-style-' . $style['name'], static::$blocks_metadata[ $block_name ]['selector'] );
    952951                }
    953952                static::$blocks_metadata[ $block_name ]['styleVariations'] = $style_selectors;
Note: See TracChangeset for help on using the changeset viewer.