From bf09ce30207072b6952fdd1162e73b7e461fa7ec Mon Sep 17 00:00:00 2001 From: Mark Woodard Date: Thu, 8 Aug 2024 15:01:44 -0500 Subject: [PATCH] updating border renders for off canvas and trigger --- .../class-kadence-blocks-off-canvas-block.php | 22 +++++++++++++------ ...adence-blocks-off-canvas-trigger-block.php | 12 ++++++++-- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/includes/blocks/header/class-kadence-blocks-off-canvas-block.php b/includes/blocks/header/class-kadence-blocks-off-canvas-block.php index 369cbf666..0e37a1317 100644 --- a/includes/blocks/header/class-kadence-blocks-off-canvas-block.php +++ b/includes/blocks/header/class-kadence-blocks-off-canvas-block.php @@ -94,12 +94,12 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { if( !empty( $attributes['widthType'] ) && $attributes['widthType'] === 'full') { $css->add_property( 'width', '100%' ); } - $css->render_border_styles( $attributes, 'border', false, array( + $css->render_border_styles( $merged_attributes, 'border', false, array( 'desktop_key' => 'border', 'tablet_key' => 'borderTablet', 'mobile_key' => 'borderMobile', ) ); - $css->render_measure_output( $attributes, 'borderRadius', 'border-radius', array( + $css->render_measure_output( $merged_attributes, 'borderRadius', 'border-radius', array( 'desktop_key' => 'borderRadius', 'tablet_key' => 'borderRadiusTablet', 'mobile_key' => 'borderRadiusMobile', @@ -107,7 +107,7 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { // inner container. $css->set_selector( '.wp-block-kadence-off-canvas' . $unique_id . ' .kb-off-canvas-inner'); - $css->render_measure_output( $attributes, 'padding', 'padding', array( + $css->render_measure_output( $merged_attributes, 'padding', 'padding', array( 'desktop_key' => 'padding', 'tablet_key' => 'paddingTablet', 'mobile_key' => 'paddingMobile', @@ -116,21 +116,29 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { // For the close icon container styles, they need to get applied to the hover state too, due to resets on hover styles in the css //close icon container $css->set_selector( '.wp-block-kadence-off-canvas' . $unique_id . ' .kb-off-canvas-close' . ', .wp-block-kadence-off-canvas' . $unique_id . ' .kb-off-canvas-close:hover' ); - $css->render_measure_output( $attributes, 'closeIconPadding', 'padding', array( + $css->render_measure_output( $merged_attributes, 'closeIconPadding', 'padding', array( 'desktop_key' => 'closeIconPadding', 'tablet_key' => 'closeIconPaddingTablet', 'mobile_key' => 'closeIconPaddingMobile', ) ); - $css->render_measure_output( $attributes, 'closeIconBorderRadius', 'border-radius', array( + $css->render_measure_output( $merged_attributes, 'closeIconBorderRadius', 'border-radius', array( 'desktop_key' => 'closeIconBorderRadius', 'tablet_key' => 'closeIconBorderRadiusTablet', 'mobile_key' => 'closeIconBorderRadiusMobile', ) ); - $css->render_border_styles( $attributes, 'closeIconBorder' ); + $css->render_border_styles( $merged_attributes, 'closeIconBorder', false, array( + 'desktop_key' => 'closeIconBorder', + 'tablet_key' => 'closeIconBorderTablet', + 'mobile_key' => 'closeIconBorderMobile', + ) ); //close icon container hover $css->set_selector( '.wp-block-kadence-off-canvas' . $unique_id . ' .kb-off-canvas-close:hover' ); - $css->render_border_styles( $attributes, 'closeIconBorderHover' ); + $css->render_border_styles( $merged_attributes, 'closeIconBorderHover', false, array( + 'desktop_key' => 'closeIconBorderHover', + 'tablet_key' => 'closeIconBorderHoverTablet', + 'mobile_key' => 'closeIconBorderHoverMobile', + ) ); //close icon $css->set_selector( '.wp-block-kadence-off-canvas' . $unique_id . ' .kb-off-canvas-close svg' ); diff --git a/includes/blocks/header/class-kadence-blocks-off-canvas-trigger-block.php b/includes/blocks/header/class-kadence-blocks-off-canvas-trigger-block.php index 95dcf86fe..977bdbaaa 100644 --- a/includes/blocks/header/class-kadence-blocks-off-canvas-trigger-block.php +++ b/includes/blocks/header/class-kadence-blocks-off-canvas-trigger-block.php @@ -107,11 +107,19 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { 'tablet_key' => 'borderRadiusTablet', 'mobile_key' => 'borderRadiusMobile', ) ); - $css->render_border_styles( $merged_attributes, 'border' ); + $css->render_border_styles( $merged_attributes, 'border', false, array( + 'desktop_key' => 'border', + 'tablet_key' => 'borderTablet', + 'mobile_key' => 'borderMobile', + )); //container hover $css->set_selector( '.wp-block-kadence-off-canvas-trigger' . $unique_id . ':hover' ); - $css->render_border_styles( $merged_attributes, 'borderHover' ); + $css->render_border_styles( $merged_attributes, 'borderHover', false, array( + 'desktop_key' => 'borderHover', + 'tablet_key' => 'borderHoverTablet', + 'mobile_key' => 'borderHoverMobile', + ) ); //icon $css->set_selector( '.wp-block-kadence-off-canvas-trigger' . $unique_id . ' svg' );