Skip to content

Commit

Permalink
fixing some off canvas and trigger issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-c-woodard committed Aug 8, 2024
1 parent 5203ce3 commit cc3e7c0
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Kadence_Blocks_Off_Canvas_Trigger_Block extends Kadence_Blocks_Abstract_Bl
*
* @var string
*/
protected $block_name = 'header-off-canvas-trigger';
protected $block_name = 'off-canvas-trigger';

/**
* Block determines in scripts need to be loaded for block.
Expand Down Expand Up @@ -92,26 +92,26 @@ 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
//container
$css->set_selector( '.wp-block-kadence-off-canvas-trigger' . $unique_id . ', .wp-block-kadence-off-canvas-trigger' . $unique_id . ':hover' );
$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',
) );
$css->render_measure_output( $attributes, 'margin', 'margin', array(
$css->render_measure_output( $merged_attributes, 'margin', 'margin', array(
'desktop_key' => 'margin',
'tablet_key' => 'marginTablet',
'mobile_key' => 'marginMobile',
) );
$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',
) );
$css->render_border_styles( $attributes, 'border' );
$css->render_border_styles( $merged_attributes, 'border' );

//container hover
$css->set_selector( '.wp-block-kadence-off-canvas-trigger' . $unique_id . ':hover' );
$css->render_border_styles( $attributes, 'borderHover' );
$css->render_border_styles( $merged_attributes, 'borderHover' );

//icon
$css->set_selector( '.wp-block-kadence-off-canvas-trigger' . $unique_id . ' svg' );
Expand Down
6 changes: 4 additions & 2 deletions src/blocks/header/children/off-canvas-trigger/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
"default": 25
},
"iconSizeTablet": {
"type": "number"
"type": "number",
"default": ""
},
"iconSizeMobile": {
"type": "number"
"type": "number",
"default": ""
},
"iconColor": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/header/children/off-canvas/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
},
"vAlign": {
"type": "string",
"default": "top"
"default": ""
},
"vAlignTablet": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/header/children/off-canvas/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export function Edit(props) {
value={vAlign ? vAlign : ''}
tabletValue={vAlignTablet ? vAlignTablet : ''}
mobileValue={vAlignMobile ? vAlignMobile : ''}
onChange={(nextAlign) => setAttributes({ vAlign: nextAlign ? nextAlign : 'center' })}
onChange={(nextAlign) => setAttributes({ vAlign: nextAlign ? nextAlign : '' })}
onChangeTablet={(nextAlign) =>
setAttributes({ vAlignTablet: nextAlign ? nextAlign : '' })
}
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/header/children/off-canvas/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
padding: 0;
z-index: 11;
display: inline-flex;
justify-content: center;
justify-content: top;
align-items: center;
color: #444444;
-webkit-appearance: none;
Expand Down
2 changes: 1 addition & 1 deletion src/blocks/header/children/off-canvas/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ $admin-bar-height-mobile: 46px;
padding: 0;
z-index: 11;
display: inline-flex;
justify-content: center;
justify-content: top;
align-items: center;
color: #444444;
-webkit-appearance: none;
Expand Down

0 comments on commit cc3e7c0

Please sign in to comment.