| @@ -5,8 +5,9 @@ | ||
| 5 | 5 | exit; |
| 6 | 6 | } |
| 7 | 7 | |
| 8 | 8 | use ABlocks\Classes\ControlBaseAbstract; |
| 9 | +use ABlocks\Controls\Color; | |
| 9 | 10 | |
| 10 | 11 | class TextStroke extends ControlBaseAbstract { |
| 11 | 12 | public static function get_attribute_default_value( $is_responsive = false ) { |
| 12 | 13 | if ( $is_responsive ) { |
| @@ -39,15 +40,18 @@ | ||
| 39 | 40 | public static function get_css( $attribute_value, $property = '', $device = '' ) { |
| 40 | 41 | if ( empty( $attribute_value ) ) { |
| 41 | 42 | return []; |
| 42 | 43 | } |
| 43 | - $default_attar_value = self::get_attribute_default_value( (bool) $device ); | |
| 44 | + // responsive_defaults(), not get_attribute_default_value( true ): the | |
| 45 | + // compilers also pass custom-breakpoint suffixes and the phantom probe, | |
| 46 | + // which the plain responsive defaults have no keys for. | |
| 47 | + $default_attar_value = $device ? self::responsive_defaults() : self::get_attribute_default_value( false ); | |
| 44 | 48 | $value = wp_parse_args( $attribute_value, $default_attar_value ); |
| 45 | 49 | $css = []; |
| 46 | 50 | |
| 47 | 51 | if ( '' !== $value[ 'strokeWidth' . $device ] ) { |
| 48 | 52 | $css['-webkit-text-stroke-width'] = $value[ 'strokeWidth' . $device ] . $value[ 'strokeWidthUnit' . $device ]; |
| 49 | - $css['-webkit-text-stroke-color'] = '' !== $value['stroke'] ? $value['stroke'] : '#000'; | |
| 53 | + $css['-webkit-text-stroke-color'] = Color::get_css( '' !== $value['stroke'] ? $value['stroke'] : '#000' ); | |
| 50 | 54 | } |
| 51 | 55 | |
| 52 | 56 | return $css; |
| 53 | 57 | } |