← All changes
|
modules/atomic-widgets/css-converter/css-converter-rest-api.php
+3
-7
4.2.0-beta1
→
4.3.2
View file →
| @@ -95,24 +95,20 @@ | ||
| 95 | 95 | * @param array<string, string|null> $declarations The block's property->value map. |
| 96 | 96 | * @return array{props: object, customCss: string, rejected: string[]} |
| 97 | 97 | */ |
| 98 | 98 | private function convert_block( Css_Converter $converter, array $declarations ): array { |
| 99 | - $resets = []; | |
| 100 | 99 | $css_declarations = []; |
| 101 | 100 | |
| 102 | 101 | foreach ( $declarations as $property => $value ) { |
| 103 | - if ( null === $value ) { | |
| 104 | - $resets[ $property ] = null; | |
| 105 | - continue; | |
| 106 | - } | |
| 102 | + $is_null_reset = null === $value || 'null' === $value; | |
| 107 | 103 | |
| 108 | - $css_declarations[] = $property . ': ' . $value . ';'; | |
| 104 | + $css_declarations[] = $property . ': ' . ( $is_null_reset ? 'null' : $value ) . ';'; | |
| 109 | 105 | } |
| 110 | 106 | |
| 111 | 107 | $result = $converter->convert( implode( ' ', $css_declarations ) ); |
| 112 | 108 | |
| 113 | 109 | return [ |
| 114 | - 'props' => (object) array_merge( $result['props'], $resets ), | |
| 110 | + 'props' => (object) $result['props'], | |
| 115 | 111 | 'customCss' => $result['customCss'], |
| 116 | 112 | 'rejected' => $result['rejected'], |
| 117 | 113 | ]; |
| 118 | 114 | } |