← All changes
|
modules/atomic-widgets/css-converter/expanders/background-shorthand-expander.php
+15
-1
4.2.0-beta1
→
trunk
View file →
| @@ -46,9 +46,23 @@ | ||
| 46 | 46 | protected function get_supported_properties(): array { |
| 47 | 47 | return [ 'background' ]; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - public function expand( array $rule ): array { | |
| 50 | + const ALL_LONGHANDS = [ | |
| 51 | + 'background-image', | |
| 52 | + 'background-repeat', | |
| 53 | + 'background-attachment', | |
| 54 | + 'background-position', | |
| 55 | + 'background-size', | |
| 56 | + 'background-clip', | |
| 57 | + 'background-color', | |
| 58 | + ]; | |
| 59 | + | |
| 60 | + protected function expand_null( array $rule ): array { | |
| 61 | + return array_map( fn( $p ) => $this->null_rule( $p ), self::ALL_LONGHANDS ); | |
| 62 | + } | |
| 63 | + | |
| 64 | + protected function do_expand( array $rule ): array { | |
| 51 | 65 | $layers = Css_Token_Splitter::split_by_comma( trim( $rule['value'] ) ); |
| 52 | 66 | |
| 53 | 67 | if ( empty( $layers ) ) { |
| 54 | 68 | return []; |