← All changes
|
modules/atomic-widgets/css-converter/converters/box-shadow-property-converter.php
+3
-7
4.2.0-dev2
→
trunk
View file →
| @@ -37,9 +37,10 @@ | ||
| 37 | 37 | * - missing color -> `currentColor` (CSS spec default) |
| 38 | 38 | * - missing blur/spread -> 0 px |
| 39 | 39 | * |
| 40 | 40 | * Special values: |
| 41 | - * - `none` -> empty Box_Shadow array (clears the prop). | |
| 41 | + * - `none` -> declines to custom_css. An empty Box_Shadow array is not persisted and renders no | |
| 42 | + * declaration, so it cannot override a shadow from a class or a wider breakpoint. | |
| 42 | 43 | */ |
| 43 | 44 | class Box_Shadow_Property_Converter extends Property_Converter_Base { |
| 44 | 45 | const INSET_KEYWORD = 'inset'; |
| 45 | 46 | const DEFAULT_COLOR = 'currentColor'; |
| @@ -54,15 +55,10 @@ | ||
| 54 | 55 | |
| 55 | 56 | protected function do_convert( Conversion_Context $context, array $rule ): bool { |
| 56 | 57 | $value = trim( $rule['value'] ); |
| 57 | 58 | |
| 58 | - if ( '' === $value ) { | |
| 59 | + if ( '' === $value || 'none' === strtolower( $value ) ) { | |
| 59 | 60 | return false; |
| 60 | - } | |
| 61 | - | |
| 62 | - if ( 'none' === strtolower( $value ) ) { | |
| 63 | - $context->set_prop( 'box-shadow', Box_Shadow_Prop_Type::generate( [] ) ); | |
| 64 | - return true; | |
| 65 | 61 | } |
| 66 | 62 | |
| 67 | 63 | $layers = Css_Token_Splitter::split_by_comma( $value ); |
| 68 | 64 | $shadows = []; |