Changeset 58749 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 07/18/2024 06:41:29 AM (6 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r58703 r58749 2889 2889 } 2890 2890 2891 /* 2892 * Top-level element styles using element-only specificity selectors should 2893 * not get wrapped in `:root :where()` to maintain backwards compatibility. 2894 * 2895 * Pseudo classes, e.g. :hover, :focus etc., are a class-level selector so 2896 * still need to be wrapped in `:root :where` to cap specificity for nested 2897 * variations etc. Pseudo selectors won't match the ELEMENTS selector exactly. 2898 */ 2899 $element_only_selector = $current_element && 2900 isset( static::ELEMENTS[ $current_element ] ) && 2901 // buttons, captions etc. still need `:root :where()` as they are class based selectors. 2902 ! isset( static::__EXPERIMENTAL_ELEMENT_CLASS_NAMES[ $current_element ] ) && 2903 static::ELEMENTS[ $current_element ] === $selector; 2904 2891 2905 // 2. Generate and append the rules that use the general selector. 2892 $block_rules .= static::to_ruleset( ":root :where($selector)", $declarations ); 2906 $general_selector = $element_only_selector ? $selector : ":root :where($selector)"; 2907 $block_rules .= static::to_ruleset( $general_selector, $declarations ); 2893 2908 2894 2909 // 3. Generate and append the rules that use the duotone selector.
Note: See TracChangeset
for help on using the changeset viewer.