megamenu && 'ast-hf-mobile-menu' !== $args->menu_id && 'ast-desktop-toggle-menu' !== $args->menu_id ) { if ( isset( $this->megamenu_text_color_group ) && '' != $this->megamenu_text_color_group ) { if ( isset( $this->megamenu_text_color_group['normal'] ) && $this->megamenu_text_color_group['normal'] ) { $style[ '.ast-desktop .menu-item-' . $this->menu_megamenu_item_id . ' .menu-item > .menu-link, .menu-item-' . $this->menu_megamenu_item_id . ' .menu-item .sub-menu > .menu-link, .ast-desktop .ast-container .menu-item-' . $this->menu_megamenu_item_id . ' .menu-item:hover' ] = array( 'color' => $this->megamenu_text_color_group['normal'], ); } if ( isset( $this->megamenu_text_color_group['hover'] ) && $this->megamenu_text_color_group['hover'] ) { $style[ '.ast-container .menu-item-' . $this->menu_megamenu_item_id . ' .menu-item .sub-menu .menu-item:hover, .ast-desktop .ast-container .menu-item-' . $this->menu_megamenu_item_id . ' .menu-item .menu-link:hover, .ast-container .menu-item-' . $this->menu_megamenu_item_id . ' .menu-item .sub-menu .menu-link:hover' ] = array( 'color' => $this->megamenu_text_color_group['hover'], ); } } $megamenu_divider_class = ''; $megamenu_class = ''; $megamenu_width = array( 'full-stretched', 'full' ); if ( in_array( $this->megamenu_width, $megamenu_width ) ) { $megamenu_class = '.astra-full-megamenu-wrapper'; } if ( isset( $this->megamenu_top_border_width ) && '' != $this->megamenu_top_border_width ) { $style[ '.ast-desktop li.astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-megamenu' ] = array( 'border-top-width' => $this->megamenu_top_border_width . 'px', ); } if ( isset( $this->megamenu_top_border_width ) && '' !== $this->megamenu_top_border_width ) { $style[ '.ast-desktop li.astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ' . $megamenu_class ] = array( 'border-top-width' => $this->megamenu_top_border_width . 'px', ); } if ( isset( $this->megamenu_column_divider_width ) && '' != $this->megamenu_column_divider_width ) { $style[ '.ast-desktop li.astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ' . $megamenu_class . ' .astra-megamenu > .menu-item' ] = array( 'border-right-width' => $this->megamenu_column_divider_width . 'px', ); } if ( isset( $this->megamenu_top_border_color ) && '' != $this->megamenu_top_border_color ) { $style[ '.ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-megamenu' ] = array( 'border-color' => $this->megamenu_top_border_color, ); $style[ '.ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ' . $megamenu_class ] = array( 'border-color' => $this->megamenu_top_border_color, ); } if ( isset( $this->megamenu_column_divider_color ) && '' != $this->megamenu_column_divider_color ) { $megamenu_divider_class = ' astra-megamenu-has-divider'; $style[ '.ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ' . $megamenu_class . ' .astra-megamenu > .menu-item' ] = array( 'border-right' => '1px solid ' . $this->megamenu_column_divider_color, ); } if ( isset( $this->megamenu_divider_style ) && '' != $this->megamenu_divider_style ) { $style[ '.ast-desktop li.astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ' . $megamenu_class . ' .astra-megamenu, .ast-desktop li.astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-megamenu > .menu-item' ] = array( 'border-style' => $this->megamenu_divider_style, ); } if ( isset( $this->megamenu_margin_top ) && '' != $this->megamenu_margin_top ) { $style[ '.ast-hfb-header.ast-desktop .main-header-menu > .menu-item-' . $this->menu_megamenu_item_id . ' > .sub-menu:before' ] = array( 'height' => astra_calculate_spacing( $this->megamenu_margin_top . 'px', '+', '5', 'px' ), ); } if ( isset( $this->megamenu_heading_color_group ) && '' != $this->megamenu_heading_color_group ) { $this->megamenu_heading_color_group = maybe_unserialize( $this->megamenu_heading_color_group ); if ( isset( $this->megamenu_heading_color_group['normal'] ) && $this->megamenu_heading_color_group['normal'] ) { $style[ '.ast-desktop .ast-mega-menu-enabled li.astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-megamenu .menu-item-heading.menu-item-has-children > .menu-link' ] = array( 'color' => $this->megamenu_heading_color_group['normal'], ); } if ( isset( $this->megamenu_heading_color_group['hover'] ) && $this->megamenu_heading_color_group['hover'] ) { $style[ '.ast-desktop .ast-mega-menu-enabled li.astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-megamenu .menu-item-heading.menu-item-has-children > .menu-link:hover' ] = array( 'color' => $this->megamenu_heading_color_group['hover'], ); } } if ( isset( $this->megamenu_bg_type ) && ( isset( $this->megamenu_bg_image ) || isset( $this->megamenu_bg_gradient ) ) ) { if ( 'image' === $this->megamenu_bg_type ) { $bg_object = array( 'background-color' => $this->megamenu_bg_color, 'background-image' => $this->megamenu_bg_image, 'background-repeat' => $this->megamenu_bg_repeat, 'background-size' => $this->megamenu_bg_size, 'background-position' => $this->megamenu_bg_position, ); } else { $bg_object = array( 'background' => $this->megamenu_bg_gradient, ); } $style[ '.ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-full-megamenu-wrapper, .ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-mega-menu-width-menu-container, .ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-mega-menu-width-content, .ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-mega-menu-width-custom' ] = 'image' === $this->megamenu_bg_type ? astra_addon_get_megamenu_background_obj( $bg_object ) : $bg_object; } if ( 'custom' === $this->megamenu_width ) { $megamenu_custom_width = $this->megamenu_custom_width; $megamenu_custom_width = ( isset( $megamenu_custom_width ) && ! empty( $megamenu_custom_width ) ) ? $megamenu_custom_width : 1200; $style[ '.ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-mega-menu-width-custom:before' ] = array( 'content' => '"' . $megamenu_custom_width . '"', 'opacity' => 0, ); } // Advanced spacing options. $margin_object = array( 'margin-top' => $this->megamenu_margin_top, 'margin-right' => $this->megamenu_margin_right, 'margin-bottom' => $this->megamenu_margin_bottom, 'margin-left' => $this->megamenu_margin_left, ); $style[ '.ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' div.astra-full-megamenu-wrapper, .ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ul.astra-mega-menu-width-menu-container, .ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ul.astra-mega-menu-width-content, .ast-desktop .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' ul.astra-mega-menu-width-custom' ] = astra_addon_get_megamenu_spacing_css( $margin_object ); $padding_object = array( 'padding-top' => $this->megamenu_padding_top, 'padding-right' => $this->megamenu_padding_right, 'padding-bottom' => $this->megamenu_padding_bottom, 'padding-left' => $this->megamenu_padding_left, ); $style[ '.ast-desktop .ast-mega-menu-enabled .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-full-megamenu-wrapper, .ast-desktop .ast-mega-menu-enabled .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-mega-menu-width-menu-container, .ast-desktop .ast-mega-menu-enabled .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-mega-menu-width-content, .ast-desktop .ast-mega-menu-enabled .astra-megamenu-li.menu-item-' . $this->menu_megamenu_item_id . ' .astra-mega-menu-width-custom' ] = astra_addon_get_megamenu_spacing_css( $padding_object ); Astra_Ext_Nav_Menu_Loader::add_css( astra_parse_css( $style ) ); if ( 'full' === $this->megamenu_width || 'full-stretched' === $this->megamenu_width ) { // Adding "hidden" class to fix the visibility issue during page load. $output .= "\n$indent