Edit: customizer-style.php
<?php defined( 'ABSPATH' ) || die(); trait CustomizerStyle { protected function get_dimension_values( $setting_name, $default = array() ) { $default_values = array( 'top' => '', 'right' => '', 'bottom' => '', 'left' => '' ); $default = wp_parse_args( $default, $default_values ); $json_value = get_theme_mod( $setting_name, wp_json_encode( $default ) ); $values = json_decode( $json_value, true ); // Ensure we have an array if ( !is_array( $values ) ) { $values = $default; } return wp_parse_args( $values, $default ); } protected function get_dimension_css( $setting_name, $property = 'padding', $default = [] ) { $default_values = wp_parse_args( $default, [ 'top' => '0', 'right' => '0', 'bottom' => '0', 'left' => '0', ] ); $json_value = get_theme_mod( $setting_name, wp_json_encode( $default_values ) ); $values = json_decode( $json_value, true ); if ( !is_array( $values ) ) { $values = $default_values; } $css_rules = []; foreach ( ['top', 'right', 'bottom', 'left'] as $side ) { $val = trim( $values[$side] ?? '' ); // Skip empty or zero-length values if ( $val === '' || $val === '0' || $val === '0px' || $val === '0em' || $val === '0%' ) { continue; } // If value already has unit (px, em, %, rem, etc.), use as is if ( preg_match( '/[a-z%]+$/i', $val ) ) { $css_rules[] = "{$property}-{$side}: {$val} !important;"; } else { // Append px unit by default if missing $css_rules[] = "{$property}-{$side}: {$val}px !important;"; } } return implode( ' ', $css_rules ); } protected function get_radius_css( $setting_name, $default = [] ) { $default_values = wp_parse_args( $default, [ 'top' => '0', 'right' => '0', 'bottom' => '0', 'left' => '0', ] ); $json_value = get_theme_mod( $setting_name, wp_json_encode( $default_values ) ); $values = json_decode( $json_value, true ); if ( !is_array( $values ) ) { $values = $default_values; } $map = [ 'top' => 'border-top-left-radius', 'right' => 'border-top-right-radius', 'bottom' => 'border-bottom-right-radius', 'left' => 'border-bottom-left-radius', ]; $css_rules = []; foreach ( $map as $key => $css_prop ) { $val = trim( $values[$key] ?? '' ); if ( $val === '' || $val === '0' || $val === '0px' || $val === '0em' || $val === '0%' ) { continue; } if ( preg_match( '/[a-z%]+$/i', $val ) ) { $css_rules[] = "{$css_prop}: {$val} !important;"; } else { $css_rules[] = "{$css_prop}: {$val}px !important;"; } } return implode( ' ', $css_rules ); } public function render_style() { $header_options = get_option( 'dnxte_header_navigation_options', array() ); $is_custom_dropdown = isset( $header_options['custom_dropdown'] ) ? $header_options['custom_dropdown'] : 0; $is_primary_menu_style = isset( $header_options['hover_animation'] ) ? $header_options['hover_animation'] : 0; $is_cta_button = isset( $header_options['cta_menu_button'] ) ? $header_options['cta_menu_button'] : 0; $is_onscroll_logo = isset( $header_options['on_scroll_logo'] ) ? $header_options['on_scroll_logo'] : 0; $is_onscroll_enabled = isset( $header_options['change_logo_onscroll'] ) ? $header_options['change_logo_onscroll'] : 0; $btn_icon_position = !empty( get_option( 'dnxte_icon_position' ) ) ? get_option( 'dnxte_icon_position' ) : 'row'; $is_cta_btn_sahdow_enabled = get_option( 'dnxte_cta_btn_shadow', 0 ); $show_shadow = get_theme_mod( 'dnxte_header_shadow' ); $shadow_color = get_option( 'dnxte_header_shadow_color' ); $hs_offset_x = get_option( 'dnxte_header_shadow_offset_x', 0 ); $hs_offset_y = get_option( 'dnxte_header_shadow_offset_y', 0 ); $hs_blur = get_option( 'dnxte_header_shadow_blur', 10 ); $hs_spread = get_option( 'dnxte_header_shadow_spread', 2 ); // fixed heade shadow $fixed_header_shadow = get_option( 'dnxte_header_shadow_fixed' ); $fixed_header_shadow_color = get_option( 'dnxte_header_shadow_color_fixed' ); $hsf_offset_x = get_option( 'dnxte_header_fixed_shadow_offset_x', 0 ); $hsf_offset_y = get_option( 'dnxte_header_fixed_shadow_offset_y', 0 ); $hsf_blur = get_option( 'dnxte_header_fixed_shadow_blur', 10 ); $hsf_spread = get_option( 'dnxte_header_fixed_shadow_spread', 2 ); $menu_padding = get_theme_mod('dnxte_padding'); if(! empty($menu_padding)) { $menu_padding_top = json_decode($menu_padding, true); $menu_padding_top = isset($menu_padding_top['top']) ? $menu_padding_top['top'] : '10'; } else { $menu_padding_top = '10'; } $cta_btn_padding = $this->get_dimension_css( 'dnxte_cta_button_padding', 'padding' ); $nav_padding = $this->get_dimension_css( 'dnxte_padding', 'padding', [ 'top' => '10', 'bottom' => '10', 'left' => '20', 'right' => '20', ] ); $cta_padding = $this->get_dimension_css('dnxte_cta_button_padding', 'padding', [ 'top' => '10', 'bottom' => '10', 'left' => '20', 'right' => '20', ] ); $hover_animated_color = get_option( 'dnxte_hover_animated_color' ); $hover_animated_color = !empty( $hover_animated_color ) ? $hover_animated_color : '#7A5AF8'; $hover_button_radius = $this->get_radius_css( 'dnxte_radius', [ 'top' => '5', 'right' => '5', 'bottom' => '5', 'left' => '5', ] ); $current_menu_hover_effect = get_theme_mod( 'dnxte_hover_active_menu' ); ?> <style type="text/css"> /* Call To Action Button style ============================*/ <?php if($is_primary_menu_style ){ ?> body.dnxte-hover-hover_effect_none #et-top-navigation #top-menu-nav>ul>li>a { padding-left: 0 !important; padding-right: 0 !important; padding-top: 0 !important; padding-bottom: 29px !important; } <?php } if ( $is_cta_button ) { ?> #main-header .dnxte-header-cta-btn-wrapper .dnxte-cta-btn { font-family: <?php echo esc_attr( get_option( 'dnxte_cta_font_select', 'Open Sans,Arial,sans-serif' ) ); ?>, sans-serif; font-size: <?php echo esc_attr( get_option( 'dnxte_cta_font_size', '14' ) ); ?>px; font-weight: <?php echo esc_attr( get_option( 'dnxte_cta_font_weight', '400' ) ); ?>; letter-spacing: <?php echo esc_attr( get_option( 'dnxte_cta_letter_spaciong', '0' ) ); ?>px; color: <?php echo esc_attr( get_option( 'dnxte_cta_text_color', '#fff' ) ); ?>; background: <?php echo esc_attr( get_option( 'dnxte_button_background_color', '#7A5AF8' ) ); ?>; border-radius: <?php echo esc_attr( get_option( 'dnxte_cta_button_border_radius', '4' ) ); ?>px; border-width: <?php echo esc_attr( get_option( 'dnxte_cta_button_border_width', '0' ) ); ?>px; border-color: <?php echo esc_attr( get_option( 'dnxte_button_border_color' ) ); ?>; <?php echo $is_cta_btn_sahdow_enabled == 1 ? esc_attr($this->boxShadow( 'dnxte_cta_btn_shadow_offset_x', 'dnxte_cta_btn_shadow_offset_y', 'dnxte_cta_btn_shadow_blur', 'dnxte_cta_btn_shadow_spread', 'dnxte_cta_btn_shadow_color' )) : 'none'; ?>; gap: <?php echo esc_attr( get_option( 'dnxte_cta_icon_gap', '5' ) ); ?>px; flex-direction: <?php echo esc_attr( $btn_icon_position ); ?>; <?php echo esc_attr($cta_padding); ?>; <?php echo esc_html( et_pb_print_font_style( 'dnxte_cta_font_style_transform' ) ); ?><?php echo esc_attr($cta_btn_padding); ?> } #main-header .dnxte-header-cta-btn-wrapper .dnxte-cta-btn:hover { --dnxte_cta_text_color_hover: <?php echo esc_attr( get_option( 'dnxte_cta_text_color_hover', '#fff' ) ) ?>; --dnxte_button_background_color_hover: <?php echo esc_attr( get_option( 'dnxte_button_background_color_hover', '#000' ) ); ?>; --dnxte_button_border_color_hover: <?php echo esc_attr( get_option( 'dnxte_button_border_color_hover', '#000' ) ); ?>; color: var(--dnxte_cta_text_color_hover); background: var(--dnxte_button_background_color_hover); border-color: var(--dnxte_button_border_color_hover); } #main-header .dnxte-header-cta-btn-wrapper .dnxte-cta-btn .dnxte-cta-icon { color: <?php echo esc_attr( get_option( 'dnxte_cta_icon_color', '#fff' ) ); ?>; font-size: <?php echo esc_attr( get_option( 'dnxte_cta_icon_size', '16' ) ); ?>px; } <?php } /* primary navigation style =======================*/ if ( $is_primary_menu_style ) {?> #top-menu-nav>ul>li>a:hover { --dnxte_menu_hover_bg_color: <?php echo esc_attr( get_option( 'dnxte_menu_hover_bg_color' ) ); ?>; color: <?php echo esc_attr( get_option( 'dnxte_menu_hover_color' ) ); ?> !important; background: var(--dnxte_menu_hover_bg_color); } .et-fixed-header #top-menu-nav>ul>li>a:hover { color: <?php echo esc_attr( get_option( 'dnxte_menu_hover_color_fixed' ) ); ?> !important; } /* menu hover style */ #et-top-navigation ul>li>a { position: relative; z-index: 1; } .dnxte-hover-hover_effect_fill_slide_up #et-top-navigation > ul>li>a, .dnxte-hover-hover_effect_fill_slide_down #et-top-navigation > ul>li>a, .dnxte-hover-hover_effect_fill_slide_left #et-top-navigation > ul>li>a, .dnxte-hover-hover_effect_fill_slide_right #et-top-navigation > ul>li>a, .dnxte-hover-hover_effect_slide_down #et-top-navigation > ul>li>a, .dnxte-hover-hover_effect_slide_up #et-top-navigation > ul>li>a, .dnxte-hover-hover_effect_slide_left #et-top-navigation > ul>li>a, .dnxte-hover-hover_effect_slide_right #et-top-navigation > ul>li>a { border: 1px solid <?php echo esc_attr($hover_animated_color); ?>; border-radius: 5px; } #et-top-navigation ul>li>a .dnxte-menu-item-animation { position: absolute; display: inline-block; width: 100%; height: 100%; z-index: -1; left: 0; top: 0; } #et-top-navigation ul>li>a .dnxte-menu-item-animation:before, #et-top-navigation ul>li>a .dnxte-menu-item-animation:after{ content: ''; } .dnxte-hover-hover_effect_fill_slide_up #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_fill_slide_down #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_fill_slide_left #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_fill_slide_right #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_up #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_left #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { position: absolute; top: 0; left: 0; right: 0; height: 100%; width: 100%; content: ""; background: <?php echo esc_attr($hover_animated_color); ?>; transition: 0.3s ease-out; z-index: -1; border-radius: 4px; opacity: 0; } #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:before, #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after{ opacity: 1; } .dnxte-hover-hover_effect_fill_slide_down #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { top: unset; bottom: 0; } .dnxte-hover-hover_effect_fill_slide_right #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { left: unset; right: 0; } .dnxte-hover-hover_effect_fill_slide_up #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_fill_slide_down #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_up #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { height: 0%; } .dnxte-hover-hover_effect_fill_slide_right #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_fill_slide_left #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_left #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { width: 0%; } .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_up #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_left #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { background: transparent; } .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_up #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_left #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { background: <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_up #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { height: 100%; } .dnxte-hover-hover_effect_slide_left #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { width: 100%; } .dnxte-hover-hover_effect_glow #et-top-navigation > ul>li>a { position: relative; transition: all 0.2s; } .dnxte-hover-hover_effect_glow #et-top-navigation > ul>li>a:hover { transform: translateY(-1px); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); border-radius: 100px; } .dnxte-hover-hover_effect_glow #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { content: ""; display: inline-block; height: 100%; width: 100%; border-radius: 100px; position: absolute; top: 0; left: 0; z-index: -1; transition: all 0.4s; background-color: <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_glow #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { transform: scaleX(1.4) scaleY(1.6); opacity: 0; } .dnxte-hover-hover_effect_borderbr #et-top-navigation ul>li>a { border-bottom: 2px solid transparent; border-radius: 8px; } .dnxte-hover-hover_effect_borderbr #et-top-navigation ul>li>a:hover { border-color: <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { position: absolute; left: -10px; top: 50%; transform: translateY(-50%) rotate(-180deg) !important; width: 6px; height: 16px; content: ""; border-width: 1.5px 1.5px 1.5px 0px; border-style: solid; border-color: <?php echo esc_attr($hover_animated_color); ?>; border-radius: 0px 2px 2px 0px; opacity: 0; transition: all 0.24s; } .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a .dnxte-menu-item-animation:before { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 6px; height: 16px; content: ""; border-width: 1.5px 1.5px 1.5px 0px; border-style: solid; border-color: <?php echo esc_attr($hover_animated_color); ?>; border-radius: 0px 2px 2px 0px; opacity: 0; transition: all 0.24s; } .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:before { opacity: 1; } .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { left: 0px; } .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:before { right: 0px; } .dnxte-hover-hover_effect_corner_in #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { position: absolute; right: 20px; top: 2px; content: ""; width: 8px; height: 8px; border-width: 2px 0px 0px 2px; border-style: solid; border-color: <?php echo esc_attr($hover_animated_color); ?>; transform: matrix(-1, 0, 0, 1, 0, 0); opacity: 0; visibility: hidden; transition: all 0.24s; } .dnxte-hover-hover_effect_corner_in #et-top-navigation ul>li>a .dnxte-menu-item-animation:before { position: absolute; left: 20px; bottom: 2px; width: 8px; height: 8px; content: ""; border-width: 2px 0px 0px 2px; border-style: solid; border-color: <?php echo esc_attr($hover_animated_color); ?>; transform: matrix(1, 0, 0, -1, 0, 0); opacity: 0; visibility: hidden; transition: all 0.24s; } .dnxte-hover-hover_effect_corner_in #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { opacity: 1; visibility: visible; right: 10px; } .dnxte-hover-hover_effect_corner_in #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:before { opacity: 1; visibility: visible; left: 10px; } /* left right all border animation */ .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a .dnxte-menu-item-animation:before, .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a .dnxte-menu-item-animation:before { position: absolute; content: ""; z-index: -1; transition: 0.35s; width: 10px; height: 10px; } .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a .dnxte-menu-item-animation:before { top: 0; left: 0; border-left: 1px solid <?php echo esc_attr($hover_animated_color); ?>; border-top: 1px solid <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { bottom: 0; right: 0; border-right: 1px solid <?php echo esc_attr($hover_animated_color); ?>; border-bottom: 1px solid <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a .dnxte-menu-item-animation:before { bottom: 0; left: 0; border-left: 1px solid <?php echo esc_attr($hover_animated_color); ?>; border-bottom: 1px solid <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { top: 0; right: 0; border-right: 1px solid <?php echo esc_attr($hover_animated_color); ?>; border-top: 1px solid <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:before, .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:before, .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { width: 99%; height: 98%; } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a .dnxte-menu-item-animation:before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: <?php echo esc_attr($hover_animated_color); ?>; transform: translate3d(-100%, 0, 0) translate3d(-1px, 0, 0); transition: transform 0.7s; transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1); } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a { overflow: hidden; transition: none; } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a .dnxte-menu-item-animation:after, .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a .dnxte-menu-item-animation:before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: <?php echo esc_attr($hover_animated_color); ?>; transform: translate3d(-100%, 0, 0) translate3d(-1px, 0, 0); transition: transform 0.7s; transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1); } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:before { transform: translate3d(100%, 0, 0) translate3d(1px, 0, 0); } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { transform: translate3d(0, 0, 0); } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { top: unset; bottom: 0; height: 1.5px; } .dnxte-hover-hover_effect_underline #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1.5px; background: <?php echo esc_attr($hover_animated_color); ?>; opacity: 0; visibility: hidden; transition: all 0.3s ease-in-out; } .dnxte-hover-hover_effect_underline #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { width: 100%; visibility: visible; opacity: 1; } .dnxte-hover-hover_effect_border_oval #et-top-navigation ul>li>a { border: 1px solid transparent; transition: all 0.3s ease-in-out; border-radius: 999px; } .dnxte-hover-hover_effect_border_oval #et-top-navigation ul>li:hover>a { border-color: <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_simple_underline #et-top-navigation ul>li>a .dnxte-menu-item-animation:after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 50%; background: linear-gradient(to top, <?php echo esc_attr($hover_animated_color); ?>, transparent 30%); transition: all 0.3s ease-in-out; opacity: 0; visibility: hidden; } .dnxte-hover-hover_effect_simple_underline #et-top-navigation ul>li>a:hover .dnxte-menu-item-animation:after { opacity: 1; visibility: visible; height: 100%; } /* apply hover effect on current menu item */ <?php if ( $current_menu_hover_effect ): ?>.dnxte-hover-hover_effect_simple_underline #et-top-navigation ul>li>a[aria-current="page"]:after { opacity: 1; visibility: visible; height: 100%; } .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a[aria-current="page"]:after, .dnxte-hover-hover_effect_brackets #et-top-navigation ul>li>a[aria-current="page"]:before { opacity: 1; } .dnxte-hover-hover_effect_border_oval #et-top-navigation ul>li>a[aria-current="page"] { border-color: <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_underline #et-top-navigation ul>li>a[aria-current="page"]:after { width: 100%; visibility: visible; opacity: 1; } .dnxte-hover-hover_effect_corner_in #et-top-navigation ul>li>a[aria-current="page"]:after { opacity: 1; visibility: visible; right: 10px; } .dnxte-hover-hover_effect_corner_in #et-top-navigation ul>li>a[aria-current="page"]:before { opacity: 1; visibility: visible; left: 10px; } .dnxte-hover-hover_effect_borderbr #et-top-navigation ul>li>a[aria-current="page"] { border-bottom: 2px solid <?php echo esc_attr($hover_animated_color); ?>; border-radius: 8px; } .dnxte-hover-hover_effect_glow #et-top-navigation ul>li>a[aria-current="page"]::after { transform: scaleX(1.4) scaleY(1.6); opacity: 0; } .dnxte-hover-hover_effect_glow #et-top-navigation ul>li>a[aria-current="page"] { transform: translateY(-1px); box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2); } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a[aria-current="page"]:before { transform: translate3d(100%, 0, 0) translate3d(1px, 0, 0); } .dnxte-hover-hover_effect_revel_border #et-top-navigation ul>li>a[aria-current="page"]:after { transform: translate3d(0, 0, 0); } .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a[aria-current="page"]:before, .dnxte-hover-hover_effect_border_lr #et-top-navigation ul>li>a[aria-current="page"]:after, .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a[aria-current="page"]:before, .dnxte-hover-hover_effect_border_rl #et-top-navigation ul>li>a[aria-current="page"]:after { width: 100%; height: 100%; } .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a[aria-current="page"]:after, .dnxte-hover-hover_effect_slide_up #et-top-navigation ul>li>a[aria-current="page"]:after, .dnxte-hover-hover_effect_slide_left #et-top-navigation ul>li>a[aria-current="page"]:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a[aria-current="page"]:after { background: <?php echo esc_attr($hover_animated_color); ?>; } .dnxte-hover-hover_effect_slide_down #et-top-navigation ul>li>a[aria-current="page"]:after, .dnxte-hover-hover_effect_slide_up #et-top-navigation ul>li>a[aria-current="page"]:after { height: 100%; } .dnxte-hover-hover_effect_slide_left #et-top-navigation ul>li>a[aria-current="page"]:after, .dnxte-hover-hover_effect_slide_right #et-top-navigation ul>li>a[aria-current="page"]:after { width: 100%; } #et-top-navigation ul>li>a{ <?php echo $hover_button_radius; // phpcs:ignore ?> } <?php endif; ?> body.dnxte-menu-hover-animation:not(.dnxte-hover-hover_effect_none) #et-top-navigation #top-menu-nav>ul>li>a { position: relative; margin-top: -10px; margin-bottom: 20px; <?php echo $nav_padding; // phpcs:ignore ?> } body.dnxte-menu-hover-animation:not(.dnxte-hover-hover_effect_none) #et-top-navigation #top-menu-nav>ul>li>a::after{ transform: translate(0, <?php echo esc_attr( $menu_padding_top ); ?>px); } #top-menu-nav>ul>li>a { margin-right: <?php echo esc_attr( get_option( 'dnxte_menu_item_space' ), '0' ); ?>px !important; } #top-menu-nav>ul>li:last-child>a { margin-right: 0px !important; } .et-fixed-header #top-menu-nav>ul>li>a { margin-right: <?php echo esc_attr( get_option( 'dnxte_menu_item_space_fixed' ), '0' ); ?>px !important; } .et-fixed-header #top-menu-nav>ul>li:last-child>a { margin-right: 0px !important; } <?php } ?> /* Menu Dropdow style ============================= */ <?php if ( $is_custom_dropdown ) {?> #top-menu-nav>ul>li.menu-item ul.sub-menu li a { --dnxte_dp_font_select_dp: <?php echo esc_attr( get_option( 'dnxte_dp_font_select_dp', 'Open Sans,Arial,sans-serif' ) ); ?>, sans-serif; --dnxte_dp_font_size_dp: <?php echo esc_attr( get_option( 'dnxte_dp_font_size_dp', '14' ) ); ?>px; --dnxte_dp_font_weight_dp: <?php echo esc_attr( get_option( 'dnxte_dp_font_weight_dp', '400' ) ); ?>; --dnxte_dp_letter_spaciong_dp: <?php echo esc_attr( get_option( 'dnxte_dp_letter_spaciong_dp', '0' ) ); ?>px; --dnxte_dp_text_color_dp: <?php echo esc_attr( get_option( 'dnxte_dp_text_color_dp', '#000' ) ); ?>; font-family: var(--dnxte_dp_font_select_dp); font-size: var(--dnxte_dp_font_size_dp); font-weight: var(--dnxte_dp_font_weight_dp); letter-spacing: var(--dnxte_dp_letter_spaciong_dp); color: var(--dnxte_dp_text_color_dp); } #top-menu-nav>ul>li.menu-item ul.sub-menu li a:hover { --dnxte_dp_text_color_hover_dp: <?php echo esc_attr( get_option( 'dnxte_dp_text_color_hover_dp', '#000' ) ); ?>; color: var(--dnxte_dp_text_color_hover_dp); } #top-menu-nav #top-menu .menu-item-has-children>a:after { --dnxte_dropdown_arrow_icon: "<?php echo esc_attr( get_option( 'dnxte_dropdown_arrow_icon', '5' ) ); ?>"; content: var(--dnxte_dropdown_arrow_icon); } <?php } if ( $show_shadow && $shadow_color ): ?>#main-header { box-shadow: <?php echo esc_attr( $hs_offset_x ); ?>px <?php echo esc_attr( $hs_offset_y ); ?>px <?php echo esc_attr( $hs_blur ); ?>px <?php echo esc_attr( $hs_spread ); ?>px <?php echo esc_attr( $shadow_color ); ?> !important; } <?php endif; if ( $fixed_header_shadow && $fixed_header_shadow_color ): ?>body #main-header.et-fixed-header { -webkit-box-shadow: <?php echo esc_attr( $hsf_offset_x ); ?>px <?php echo esc_attr( $hsf_offset_y ); ?>px <?php echo esc_attr( $hsf_blur ); ?>px <?php echo esc_attr( $hsf_spread ); ?>px <?php echo esc_attr( $fixed_header_shadow_color ); ?> !important; box-shadow: <?php echo esc_attr( $hsf_offset_x ); ?>px <?php echo esc_attr( $hsf_offset_y ); ?>px <?php echo esc_attr( $hsf_blur ); ?>px <?php echo esc_attr( $hsf_spread ); ?>px <?php echo esc_attr( $fixed_header_shadow_color ); ?> !important; } <?php endif; // On Scroll Logo Style =============== if ( $is_onscroll_logo && $is_onscroll_enabled ) {?> #main-header.et-fixed-header #logo, #main-header:not(.et-fixed-header) .dnxte_on_scroll_logo { display: none; } .et-fixed-header .dnxte_on_scroll_logo{ display: flex; align-items: center; justify-content: center; width: auto; -webkit-transition: all 0.4s ease-in-out; transition: all 0.4s ease-in-out; margin-bottom: 0; max-height: 54%; display: inline-block; float: none; vertical-align: middle; -webkit-transform: translate3d(0, 0, 0); } <?php } ?> </style> <?php } /** * Generates a box-shadow CSS property. * * @param string $horizontal_offset The horizontal offset of the shadow. * @param string $vertical_offset The vertical offset of the shadow. * @param string $blur_radius The blur radius of the shadow. * @param string $spread_radius The spread radius of the shadow. * @param string $color The color of the shadow. * * @return string The box-shadow CSS property. */ public function boxShadow( $horizontal_offset, $vertical_offset, $blur_radius, $spread_radius, $color ) { $horizontal_offset = null !== get_option( $horizontal_offset ) ? get_option( $horizontal_offset ) : '0'; $vertical_offset = null !== get_option( $vertical_offset ) ? get_option( $vertical_offset ) : '0'; $blur_radius = null !== get_option( $blur_radius ) ? get_option( $blur_radius ) : '10'; $spread_radius = null !== get_option( $spread_radius ) ? get_option( $spread_radius ) : '0'; $color = null !== get_option( $color ) ? get_option( $color ) : '#000000'; return sprintf( 'box-shadow: %spx %spx %spx %spx %s;', esc_attr( $horizontal_offset ), esc_attr( $vertical_offset ), esc_attr( $blur_radius ), esc_attr( $spread_radius ), esc_attr( $color ) ); } }
Save
Back