Automattic\WooCommerce\Blocks\Utils
StyleAttributesUtils::get_shadow_class_and_style
Get class and style for shadow from attributes.
Method of the class: StyleAttributesUtils{}
No Hooks.
Returns
Array.
Usage
$result = StyleAttributesUtils::get_shadow_class_and_style( $attributes );
- $attributes(array) (required)
- Block attributes.
StyleAttributesUtils::get_shadow_class_and_style() StyleAttributesUtils::get shadow class and style code WC 10.8.1
public static function get_shadow_class_and_style( $attributes ) {
$shadow = $attributes['style']['shadow'] ?? null;
if ( ! $shadow ) {
return self::EMPTY_STYLE;
}
return array(
'class' => null,
'style' => sprintf( 'box-shadow: %s;', self::get_shadow_value( $shadow ) ),
);
}