diff --git a/includes/blocks/class-kadence-blocks-navigation-block.php b/includes/blocks/class-kadence-blocks-navigation-block.php index 200f6c2df..2444d9601 100644 --- a/includes/blocks/class-kadence-blocks-navigation-block.php +++ b/includes/blocks/class-kadence-blocks-navigation-block.php @@ -82,10 +82,13 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { } $css->set_media_state( 'desktop' ); - //no added specificty needed for these variables + // No added specificty needed for these variables. $css->set_selector( '.wp-block-kadence-navigation' . $unique_id ); - $css->render_measure_output( $nav_attributes, 'marginDropdown', '--kb-nav-dropdown-margin', ['unit_key' => 'marginDropdownUnit']); - $css->render_measure_output( $nav_attributes, 'paddingDropdown', '--kb-nav-dropdown-padding', ['unit_key' => 'paddingDropdownUnit']); + $css->render_measure_output( $nav_attributes, 'marginDropdown', '--kb-nav-dropdown-margin', [ 'unit_key' => 'marginDropdownUnit' ] ); + $css->render_measure_output( $nav_attributes, 'paddingDropdown', '--kb-nav-dropdown-padding', [ 'unit_key' => 'paddingDropdownUnit' ] ); + if ( isset( $nav_attributes['dropdownShadow'][0]['enable'] ) && $nav_attributes['dropdownShadow'][0]['enable'] ) { + $css->add_property( '--kb-nav-dropdown-box-shadow', $css->render_shadow( $nav_attributes['dropdownShadow'][0] ) ); + } //main container (don't apply to children) $css->set_selector( '.wp-block-kadence-navigation' . $unique_id . ' > .navigation > .menu-container > .menu'); @@ -178,12 +181,15 @@ public function sized_dynamic_styles( $css, $attributes, $unique_id, $size = 'De } if ( $sized_attributes['orientation'] != 'vertical' ) { +<<<<<<< Updated upstream $css->add_property( '--kb-nav-dropdown-link-width', $css->render_size( $sized_attributes['dropdownWidth'], $sized_attributes['dropdownWidthUnit'] ) ); $css->add_property( '--kb-nav-top-not-last-link-border-right', $css->render_border( $sized_attributes['divider'], 'bottom' ) ); if ( $sized_attributes['dropdownShadow'] && isset( $sized_attributes['dropdownShadow'][0] ) && $sized_attributes['dropdownShadow'][0]['enable'] ) { $css->add_property( '--kb-nav-dropdown-box-shadow', $css->render_shadow( $sized_attributes['dropdownShadow'][0] ) ); } +======= +>>>>>>> Stashed changes if ( $sized_attributes['dropdownHorizontalAlignment'] == 'center' ) { $css->add_property( '--kb-nav-dropdown-show-left', '50%' ); diff --git a/includes/blocks/class-kadence-blocks-navigation-link-block.php b/includes/blocks/class-kadence-blocks-navigation-link-block.php index 8bc7b6ae8..76f986359 100644 --- a/includes/blocks/class-kadence-blocks-navigation-link-block.php +++ b/includes/blocks/class-kadence-blocks-navigation-link-block.php @@ -222,8 +222,7 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) { 'mobile_key' => 'dropdownBorderRadiusMobile', ) ); $css->render_border_styles( $nav_link_attributes, 'dropdownBorder' ); - - if ( $nav_link_attributes['dropdownShadow'] && isset( $nav_link_attributes['dropdownShadow'][0] ) && $nav_link_attributes['dropdownShadow'][0]['enable'] ) { + if ( isset( $nav_link_attributes['dropdownShadow'][0]['enable'] ) && $nav_link_attributes['dropdownShadow'][0]['enable'] ) { $css->add_property( 'box-shadow', $css->render_shadow( $nav_link_attributes['dropdownShadow'][0] ) ); } @@ -343,6 +342,7 @@ public function sized_dynamic_styles( $css, $attributes, $unique_id, $size = 'De $css->add_property( '--kb-nav-dropdown-link-color', $css->render_color( $sized_attributes['linkColorDropdown'] ), $sized_attributes['linkColorDropdown'] ); $css->add_property( '--kb-nav-dropdown-link-color-hover', $css->render_color( $sized_attributes['linkColorDropdownHover'] ), $sized_attributes['linkColorDropdownHover'] ); $css->add_property( '--kb-nav-dropdown-link-color-active', $css->render_color( $sized_attributes['linkColorDropdownActive']), $sized_attributes['linkColorDropdownActive'] ); +<<<<<<< Updated upstream $css->add_property( '--kb-nav-dropdown-link-color-active-ancestor', $css->render_color( $sized_attributes['linkColorDropdownActive']), $sized_attributes['parentActive'] && $sized_attributes['linkColorDropdownActive'] ); $css->add_property( '--kb-nav-dropdown-background', $css->render_color( $sized_attributes['backgroundDropdown'] ) ); $css->add_property( '--kb-nav-dropdown-link-background-hover', $css->render_color( $sized_attributes['backgroundDropdownHover'] )); @@ -351,13 +351,16 @@ public function sized_dynamic_styles( $css, $attributes, $unique_id, $size = 'De $css->add_property( '--kb-nav-dropdown-link-padding-top', $css->render_size( $sized_attributes['dropdownVerticalSpacing'], $attributes['dropdownVerticalSpacingUnit'] ) ); $css->add_property( '--kb-nav-dropdown-link-padding-bottom', $css->render_size( $sized_attributes['dropdownVerticalSpacing'], $attributes['dropdownVerticalSpacingUnit'] ) ); +======= + $css->add_property( '--kb-nav-dropdown-link-color-active-ancestor', $css->render_color( $sized_attributes['linkColorDropdownActive'] ), $sized_attributes['linkColorDropdownActive'] ); +>>>>>>> Stashed changes //no bleed variables (extra specific to beat things like dropdown or top level styling) $css->set_selector( '.kb-nav-link-' . $unique_id . ' > .kb-link-wrap.kb-link-wrap.kb-link-wrap.kb-link-wrap' ); $css->add_property( '--kb-nav-link-color', $css->render_color( $sized_attributes['linkColor'] ), $sized_attributes['linkColor'] ); $css->add_property( '--kb-nav-link-color-hover', $css->render_color( $sized_attributes['linkColorHover'] ), $sized_attributes['linkColorHover'] ); $css->add_property( '--kb-nav-link-color-active', $css->render_color( $sized_attributes['linkColorActive']), $sized_attributes['linkColorActive'] ); - $css->add_property( '--kb-nav-link-color-active-ancestor', $css->render_color( $sized_attributes['linkColorActive']), $sized_attributes['parentActive'] && $sized_attributes['linkColorActive'] ); + $css->add_property( '--kb-nav-link-color-active-ancestor', $css->render_color( $sized_attributes['linkColorActive']), $sized_attributes['linkColorActive'] ); diff --git a/src/blocks/navigation/style.scss b/src/blocks/navigation/style.scss index edc44e87b..973fd9dd4 100644 --- a/src/blocks/navigation/style.scss +++ b/src/blocks/navigation/style.scss @@ -648,7 +648,7 @@ --kb-nav-link-padding-bottom: var(--kb-nav-dropdown-link-padding-bottom); & > .kb-nav-link-content { - width: var(--kb-nav-dropdown-link-width); + width: var(--kb-nav-dropdown-link-width, 200px); } } }