Skip to content

Commit

Permalink
updating border renders for off canvas and trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-c-woodard committed Aug 8, 2024
1 parent bda47dd commit bf09ce3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
22 changes: 15 additions & 7 deletions includes/blocks/header/class-kadence-blocks-off-canvas-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,20 @@ 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',
) );

// 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',
Expand All @@ -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' );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down

0 comments on commit bf09ce3

Please sign in to comment.