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
CustomHeight.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | |
| 4 | namespace Kubio\Core\StyleManager\Props; |
| 5 | |
| 6 | use Kubio\Core\LodashBasic; |
| 7 | use Kubio\Core\StyleManager\ParserUtils; |
| 8 | |
| 9 | class CustomHeight extends PropertyBase { |
| 10 | public function parse( $value, $options ) { |
| 11 | $mergedValue = (object) $this->valueWithDefault( $value ); |
| 12 | |
| 13 | $types = $this->config( 'enums.types' ); |
| 14 | $typeToConst = array_flip( $types ); |
| 15 | |
| 16 | $typeConstName = $typeToConst[ $mergedValue->type ]; |
| 17 | |
| 18 | $cssByType = $this->config( 'config.cssByType' ); |
| 19 | $minHeights = $this->config( 'config.minHeightByType' ); |
| 20 | |
| 21 | if ( $typeConstName == 'MIN_HEIGHT' ) { |
| 22 | $minHeights['MIN_HEIGHT'] = $mergedValue->{$types['MIN_HEIGHT']}; |
| 23 | } |
| 24 | |
| 25 | $style = LodashBasic::get( $cssByType, $typeConstName, array() ); |
| 26 | |
| 27 | if ( isset( $minHeights[ $typeConstName ] ) ) { |
| 28 | ParserUtils::addValueUnitString( $style, 'min-height', $minHeights[ $typeConstName ] ); |
| 29 | } |
| 30 | |
| 31 | return $style; |
| 32 | } |
| 33 | } |
| 34 |