Animation.php
1 year ago
Background.php
1 year ago
BackgroundImage.php
1 year ago
Border.php
2 years ago
BoxShadow.php
1 year ago
ColumnWidth.php
1 year ago
CustomHeight.php
1 year ago
CustomSize.php
4 years ago
Gap.php
1 year ago
Height.php
1 year ago
JustifyContent.php
1 year ago
MaxWidth.php
1 year ago
MultipleImage.php
1 year ago
ObjectCss.php
1 year ago
Opacity.php
1 year ago
Property.php
1 year ago
PropertyBase.php
1 year ago
Size.php
1 year ago
Stroke.php
1 year ago
TBLR.php
1 year ago
TextShadow.php
1 year ago
Transform.php
2 years ago
Transition.php
1 year ago
Typography.php
1 month ago
UnitValuePercentage.php
1 year ago
UnitValuePx.php
1 year ago
ValueProxy.php
4 years ago
Width.php
1 year ago
BoxShadow.php
29 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Kubio\Core\StyleManager\Props; |
| 5 | |
| 6 | |
| 7 | use Kubio\Core\LodashBasic; |
| 8 | use Kubio\Core\StyleManager\ParserUtils; |
| 9 | use function join; |
| 10 | |
| 11 | class BoxShadow extends PropertyBase { |
| 12 | public function parse( $value, $options ) { |
| 13 | $enabled = LodashBasic::get( $value, 'enabled', false ); |
| 14 | if ( ! $enabled ) { |
| 15 | return array( |
| 16 | 'boxShadow' => 'none', |
| 17 | ); |
| 18 | } |
| 19 | |
| 20 | $layerDefault = LodashBasic::get( $this->config( 'default' ), 'layers.0', array() ); |
| 21 | $layer = LodashBasic::merge( $layerDefault, LodashBasic::get( $value, 'layers.0', array() ) ); |
| 22 | $style = array(); |
| 23 | if ( ParserUtils::areAllNonEmpty( LodashBasic::omit( $layer, 'inset' ) ) ) { |
| 24 | $style['boxShadow'] = join( ' ', array( "{$layer['x']}px", "{$layer['y']}px", "{$layer['blur']}px", "{$layer['spread']}px", $layer['color'], $layer['inset'] ) ); |
| 25 | } |
| 26 | return $style; |
| 27 | } |
| 28 | } |
| 29 |