Changeset 58421
- Timestamp:
- 06/17/2024 03:47:37 AM (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r58413 r58421 2648 2648 * @since 6.6.0 Setting a min-height of HTML when root styles have a background gradient or image. 2649 2649 * Updated general global styles specificity to 0-1-0. 2650 * Fixed custom CSS output in block style variations. 2650 2651 * 2651 2652 * @param array $block_metadata Metadata about the block to get styles for. … … 2663 2664 // If there are style variations, generate the declarations for them, including any feature selectors the block may have. 2664 2665 $style_variation_declarations = array(); 2666 $style_variation_custom_css = array(); 2665 2667 if ( ! empty( $block_metadata['variations'] ) ) { 2666 2668 foreach ( $block_metadata['variations'] as $style_variation ) { … … 2692 2694 // Compute declarations for remaining styles not covered by feature level selectors. 2693 2695 $style_variation_declarations[ $style_variation['selector'] ] = static::compute_style_properties( $style_variation_node, $settings, null, $this->theme_json ); 2696 // Store custom CSS for the style variation. 2697 if ( isset( $style_variation_node['css'] ) ) { 2698 $style_variation_custom_css[ $style_variation['selector'] ] = $this->process_blocks_custom_css( $style_variation_node['css'], $style_variation['selector'] ); 2699 } 2694 2700 } 2695 2701 } … … 2820 2826 foreach ( $style_variation_declarations as $style_variation_selector => $individual_style_variation_declarations ) { 2821 2827 $block_rules .= static::to_ruleset( ":root :where($style_variation_selector)", $individual_style_variation_declarations ); 2828 if ( isset( $style_variation_custom_css[ $style_variation_selector ] ) ) { 2829 $block_rules .= $style_variation_custom_css[ $style_variation_selector ]; 2830 } 2831 } 2832 2833 // 7. Generate and append any custom CSS rules pertaining to nested block style variations. 2834 if ( isset( $node['css'] ) && ! $is_root_selector ) { 2835 $block_rules .= $this->process_blocks_custom_css( $node['css'], $selector ); 2822 2836 } 2823 2837
Note: See TracChangeset
for help on using the changeset viewer.