| @@ -105,19 +105,10 @@ | ||
| 105 | 105 | $color_block_styles['background'] = $preset_background_color ? $preset_background_color : $custom_background_color; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | // Gradients. |
| 109 | - // Suppress color.gradient CSS when background.gradient is supported and | |
| 110 | - // explicitly set. background.php owns CSS generation in that case, and | |
| 111 | - // emitting the background shorthand here would conflict with it. | |
| 112 | - $has_background_gradient_support = block_has_support( $block_type, array( 'background', 'gradient' ), false ); | |
| 113 | - $has_background_gradient_value = ! empty( $block_attributes['style']['background']['gradient'] ); | |
| 114 | 109 | |
| 115 | - if ( | |
| 116 | - $has_gradients_support && | |
| 117 | - ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'gradients' ) && | |
| 118 | - ! ( $has_background_gradient_support && $has_background_gradient_value ) | |
| 119 | - ) { | |
| 110 | + if ( $has_gradients_support && ! wp_should_skip_block_supports_serialization( $block_type, 'color', 'gradients' ) ) { | |
| 120 | 111 | $preset_gradient_color = array_key_exists( 'gradient', $block_attributes ) ? "var:preset|gradient|{$block_attributes['gradient']}" : null; |
| 121 | 112 | $custom_gradient_color = $block_attributes['style']['color']['gradient'] ?? null; |
| 122 | 113 | $color_block_styles['gradient'] = $preset_gradient_color ? $preset_gradient_color : $custom_gradient_color; |
| 123 | 114 | } |