Skip to content

Commit

Permalink
chore: pass condition for shadow opacity
Browse files Browse the repository at this point in the history
  • Loading branch information
Soare-Robert-Daniel committed Aug 25, 2023
1 parent 6672445 commit ae2e5ff
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions inc/css/blocks/class-shared-css.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,14 @@ public static function section_shared() {
'value' => 'boxShadowColor',
'default' => '#000',
'format' => function( $value, $attrs ) {
if ( ! isset( $attrs['boxShadowColorOpacity'] ) ) {
return $value;
}

if ( 100 === $attrs['boxShadowColorOpacity'] ) {
return $value;
}

$opacity = ( isset( $attrs['boxShadowColorOpacity'] ) ? $attrs['boxShadowColorOpacity'] : 50 ) / 100;
return Base_CSS::hex2rgba( $value, $opacity );
},
Expand Down

0 comments on commit ae2e5ff

Please sign in to comment.