PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / trunk
Kubio AI Page Builder vtrunk
2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / lib / src / Core / StyleManager / Props / Border.php
kubio / lib / src / Core / StyleManager / Props Last commit date
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
Border.php
48 lines
1 <?php
2
3 namespace Kubio\Core\StyleManager\Props;
4
5 use Kubio\Config;
6 use Kubio\Core\LodashBasic;
7 use Kubio\Core\StyleManager\ParserUtils;
8
9 class Border extends PropertyBase {
10
11 public function parse( $value, $options ) {
12 $borderWithRadius = $this->valueWithDefault( $value );
13 $style = array();
14 foreach ( $borderWithRadius as $side => $border_side ) {
15 $border_width = LodashBasic::get( $border_side, 'width.value' );
16
17 $side_props = array( 'color', 'width', 'style' );
18
19 if ( ! is_numeric( $border_width ) ) {
20 $side_props = array( 'color' );
21 }
22
23 foreach ( $side_props as $prop ) {
24 if ( isset( $border_side[ $prop ] ) ) {
25 ParserUtils::addValueUnitString(
26 $style,
27 'border-' . $side . '-' . $prop,
28 $border_side[ $prop ]
29 );
30 }
31 }
32 }
33
34 $radiuses = Config::value( 'props.border.radiusMap' );
35 foreach ( array_keys( $radiuses ) as $path ) {
36 $radius = LodashBasic::get(
37 $borderWithRadius,
38 $radiuses[ $path ],
39 null
40 );
41 if ( $radius !== null ) {
42 ParserUtils::addValueUnitString( $style, $path, $radius );
43 }
44 }
45 return $style;
46 }
47 }
48