Skip to content

Commit

Permalink
Merge pull request #524 from stellarwp/bugfix/KAD-3086
Browse files Browse the repository at this point in the history
bugfix/KAD-3086
  • Loading branch information
oakesjosh authored Aug 14, 2024
2 parents cdc0a2b + 9c5141e commit 9b8a3fc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion includes/blocks/class-kadence-blocks-image-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
$overlay_type = ! empty( $attributes['overlayType'] ) ? $attributes['overlayType'] : 'normal';
$css->set_selector( '.kb-image' . $unique_id . ' .kb-image-has-overlay:after' );
$opacity = isset( $attributes['overlayOpacity'] ) ? $attributes['overlayOpacity'] : 0.3;

if ( $css->is_number( $opacity ) ) {
$css->add_property( 'opacity', $opacity );
}
Expand All @@ -157,8 +158,12 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
}
break;
}
$css->set_selector( '.kb-image' . $unique_id . ' img.kb-img, .kb-image' . $unique_id . ' .kb-img img' );

// Border Radius.
$css->render_measure_output( $attributes, 'borderRadius', 'border-radius', array( 'unit_key' => 'borderRadiusUnit' ) );

$css->set_media_state( 'desktop' );
$css->set_selector( '.kb-image' . $unique_id . ' img.kb-img, .kb-image' . $unique_id . ' .kb-img img' );
// Support borders saved pre 3.0
if ( !empty( $attributes['borderColor'] ) ) {
$css->add_property( 'border-style', 'solid' );
Expand Down
12 changes: 12 additions & 0 deletions src/blocks/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,18 @@ export default function Image({
{previewOverlay
? `.kadence-image${uniqueID} .kb-image-has-overlay:after { background:${previewOverlay}; }`
: ''}
{previewOverlay && previewRadiusTop
? `.kadence-image${uniqueID} .kb-image-has-overlay:after { border-top-left-radius:${previewRadiusTop}${borderRadiusUnit}; }`
: ''}
{previewOverlay && previewRadiusRight
? `.kadence-image${uniqueID} .kb-image-has-overlay:after { border-top-right-radius:${previewRadiusRight}${borderRadiusUnit}; }`
: ''}
{previewOverlay && previewRadiusBottom
? `.kadence-image${uniqueID} .kb-image-has-overlay:after { border-bottom-right-radius:${previewRadiusBottom}${borderRadiusUnit}; }`
: ''}
{previewOverlay && previewRadiusLeft
? `.kadence-image${uniqueID} .kb-image-has-overlay:after { border-bottom-left-radius:${previewRadiusLeft}${borderRadiusUnit}; }`
: ''}
{previewMaxWidth
? `.kadence-inner-column-inner:where(.section-is-flex) > .kadence-image${uniqueID} { max-width: ${previewMaxWidth}px; }`
: ''}
Expand Down

0 comments on commit 9b8a3fc

Please sign in to comment.