8889841cclass-astra-mobile-menu-component-loader.php 0000644 00000002401 15051510473 0015143 0 ustar 00 ).
*
* @since 3.0.0
* @var Array
*/
$menu_classes = apply_filters( 'astra_primary_menu_classes', array( 'main-header-menu', 'ast-nav-menu', 'ast-flex', $submenu_class, $stack_on_mobile_class ) );
$items_wrap = ' 'ast-' . esc_attr( $device ) . '-site-navigation',
'class' => 'site-navigation ast-flex-grow-1 navigation-accessibility site-header-focus-item',
'aria-label' => esc_attr__( 'Site Navigation', 'astra' ),
)
);
$items_wrap .= '>';
$items_wrap .= '';
$items_wrap .= '
';
$items_wrap .= '
';
$items_wrap .= ' ';
// Fallback Menu if primary menu not set.
$fallback_menu_args = array(
'theme_location' => $theme_location,
'menu_id' => $menu_id,
'menu_class' => 'main-navigation',
'container' => 'div',
'before' => '
',
'walker' => new Astra_Walker_Page(),
);
// To add default alignment for navigation which can be added through any third party plugin.
// Do not add any CSS from theme except header alignment.
echo '';
if ( is_customize_preview() ) {
Astra_Builder_UI_Controller::render_customizer_edit_button();
}
if ( has_nav_menu( $theme_location ) ) {
wp_nav_menu(
array(
'menu_id' => $menu_id,
'menu_class' => esc_attr( implode( ' ', $menu_classes ) ),
'container' => 'div',
'container_class' => 'main-header-bar-navigation',
'items_wrap' => $items_wrap,
'theme_location' => $theme_location,
)
);
} else {
echo '
';
echo ' 'ast-' . esc_attr( $device ) . '-site-navigation',
)
);
echo ' class="site-navigation ast-flex-grow-1 navigation-accessibility" aria-label="' . esc_attr__( 'Site Navigation', 'astra' ) . '">';
wp_page_menu( $fallback_menu_args );
echo ' ';
echo '
';
}
echo '
';
}
}
/**
* Kicking this off by creating an object.
*/
new Astra_Mobile_Menu_Component();
assets/js/minified/customizer-preview.min.js 0000644 00000020615 15051510473 0015256 0 ustar 00 !function(){var n=AstraBuilderMenuData.tablet_break_point||768,a=AstraBuilderMenuData.mobile_break_point||544,e=".ast-builder-menu-mobile .main-navigation";astra_builder_visibility_css("section-header-mobile-menu",e,"block"),astra_generate_outside_font_family_css("astra-settings[header-mobile-menu-font-family]",e+" .menu-item > .menu-link"),astra_generate_font_weight_css("astra-settings[header-mobile-menu-font-family]","astra-settings[header-mobile-menu-font-weight]","font-weight",e+" .menu-item > .menu-link"),astra_responsive_font_size("astra-settings[header-mobile-menu-font-size]",e+" .menu-item > .menu-link"),astra_font_extras_css("font-extras-header-mobile-menu",".ast-builder-menu-mobile .main-navigation .menu-item > .menu-link"),astra_color_responsive_css("astra-menu-color-preview","astra-settings[header-mobile-menu-color-responsive]","color",e+" .main-header-menu .menu-item > .menu-link"),astra_color_responsive_css("astra-menu-h-color-preview","astra-settings[header-mobile-menu-h-color-responsive]","color",e+" .menu-item:hover > .menu-link, "+e+" .inline-on-mobile .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-builder-toggle","astra-settings[header-mobile-menu-color-responsive]","color",e+" .menu-item > .ast-menu-toggle"),astra_color_responsive_css("astra-menu-h-toogle-color-preview","astra-settings[header-mobile-menu-h-color-responsive]","color",e+" .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-menu-active-color-preview","astra-settings[header-mobile-menu-a-color-responsive]","color",e+" .menu-item.current-menu-item > .menu-link, "+e+" .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle"),astra_apply_responsive_background_css("astra-settings[header-mobile-menu-bg-obj-responsive]",e+" .main-header-menu, "+e+" .main-header-menu .sub-menu","desktop"),astra_apply_responsive_background_css("astra-settings[header-mobile-menu-bg-obj-responsive]",e+" .main-header-menu, "+e+" .main-header-menu .sub-menu","tablet"),astra_apply_responsive_background_css("astra-settings[header-mobile-menu-bg-obj-responsive]",e+" .main-header-menu, "+e+" .main-header-menu .sub-menu","mobile"),astra_color_responsive_css("astra-menu-bg-preview","astra-settings[header-mobile-menu-h-bg-color-responsive]","background",e+" .menu-item:hover > .menu-link, "+e+" .inline-on-mobile .menu-item:hover > .ast-menu-toggle"),astra_color_responsive_css("astra-builder","astra-settings[header-mobile-menu-a-bg-color-responsive]","background",e+" .menu-item.current-menu-item > .menu-link, "+e+" .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle"),wp.customize("astra-settings[header-mobile-menu-submenu-item-b-size]",function(e){e.bind(function(e){var t=".ast-hfb-header .ast-builder-menu-mobile .main-navigation",i=(i=(i=(i="")+(t+" .main-header-menu {")+("border-top-width: "+e+"px;"))+"} "+(t+" .menu-item .sub-menu .menu-link, "+t+" .menu-item .menu-link {"))+("border-bottom-width: "+e+"px;")+"} ";astra_add_dynamic_css("header-mobile-menu-submenu-item-b-size",i)})}),wp.customize("astra-settings[header-mobile-menu-submenu-border]",function(e){e.bind(function(e){var t=".ast-builder-menu-mobile .sub-menu {",t=(t=(t=(t+="border-top-width:"+e.top+"px;")+("border-right-width:"+e.right+"px;"))+("border-left-width:"+e.left+"px;")+"border-style: solid;")+("border-bottom-width:"+e.bottom+"px;")+"}";astra_add_dynamic_css("header-mobile-menu-submenu-border",t)})}),wp.customize("astra-settings[header-mobile-menu-menu-spacing]",function(e){e.bind(function(e){var t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t="")+".ast-hfb-header .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {"+("padding-left: "+e.desktop.left+e["desktop-unit"]+";"))+("padding-right: "+e.desktop.right+e["desktop-unit"]+";"))+("padding-top: "+e.desktop.top+e["desktop-unit"]+";"))+("padding-bottom: "+e.desktop.bottom+e["desktop-unit"]+";")+"} ")+".ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {"+("top: "+e.desktop.top+e["desktop-unit"]+";"))+("right: calc( "+e.desktop.right+e["desktop-unit"]+" - 0.907em );"))+"} "+("@media (max-width: "+n+"px) {"))+".ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {"+("padding-left: "+e.tablet.left+e["tablet-unit"]+";"))+("padding-right: "+e.tablet.right+e["tablet-unit"]+";"))+("padding-top: "+e.tablet.top+e["tablet-unit"]+";"))+("padding-bottom: "+e.tablet.bottom+e["tablet-unit"]+";")+"} ")+".ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {"+("top: "+e.tablet.top+e["tablet-unit"]+";"))+("right: calc( "+e.tablet.right+e["tablet-unit"]+" - 0.907em );")+"} ")+"} "+("@media (max-width: "+a+"px) {"))+".ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {"+("padding-left: "+e.mobile.left+e["mobile-unit"]+";"))+("padding-right: "+e.mobile.right+e["mobile-unit"]+";"))+("padding-top: "+e.mobile.top+e["mobile-unit"]+";"))+("padding-bottom: "+e.mobile.bottom+e["mobile-unit"]+";")+"} ")+".ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {"+("top: "+e.mobile.top+e["mobile-unit"]+";"))+("right: calc( "+e.mobile.right+e["mobile-unit"]+" - 0.907em );"))+"} "+"} ";astra_add_dynamic_css("header-mobile-menu-menu-spacing-toggle-button",t)})}),wp.customize("astra-settings[section-header-mobile-menu-margin]",function(e){e.bind(function(e){var t=".ast-builder-menu-mobile .main-header-menu, .ast-header-break-point .ast-builder-menu-mobile .main-header-menu",i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i=(i="")+(t+" {")+("margin-left: "+e.desktop.left+e["desktop-unit"]+";"))+("margin-right: "+e.desktop.right+e["desktop-unit"]+";"))+("margin-top: "+e.desktop.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.desktop.bottom+e["desktop-unit"]+";"))+"} "+("@media (max-width: "+n+"px) {"))+(t+" {")+("margin-left: "+e.tablet.left+e["tablet-unit"]+";"))+("margin-right: "+e.tablet.right+e["tablet-unit"]+";"))+("margin-top: "+e.tablet.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.tablet.bottom+e["desktop-unit"]+";")+"} ")+"} "+("@media (max-width: "+a+"px) {"))+(t+" {")+("margin-left: "+e.mobile.left+e["mobile-unit"]+";"))+("margin-right: "+e.mobile.right+e["mobile-unit"]+";"))+("margin-top: "+e.mobile.top+e["desktop-unit"]+";"))+("margin-bottom: "+e.mobile.bottom+e["desktop-unit"]+";"))+"} "+"} ";astra_add_dynamic_css("section-header-mobile-menu-margin",i)})}),wp.customize("astra-settings[header-mobile-menu-submenu-item-b-color]",function(e){e.bind(function(e){var t,i=wp.customize("astra-settings[header-mobile-menu-submenu-item-border]").get(),n=wp.customize("astra-settings[header-mobile-menu-submenu-item-b-size]").get();""!=e&&1==i?(t="",t=(t=(t=(t=(t+=".ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .menu-link")+"{border-bottom-width:"+(!0===i?n+"px;":"0px;"))+"border-color:"+e+";border-style: solid;}.ast-hfb-header .ast-builder-menu-mobile .main-navigation .main-header-menu")+"{border-top-width:"+(!0===i?n+"px;":"0px;"))+"border-color:"+e+";}",astra_add_dynamic_css("header-mobile-menu-submenu-item-b-color",t)):wp.customize.preview.send("refresh")})}),wp.customize("astra-settings[header-mobile-menu-submenu-item-border]",function(e){e.bind(function(e){var t,i=wp.customize("astra-settings[header-mobile-menu-submenu-item-b-color]").get(),n=wp.customize("astra-settings[header-mobile-menu-submenu-item-b-size]").get();!0===e?(t=".ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .menu-link",t=(t=(t=(t+="{")+"border-bottom-width:"+(!0===e?n+"px;":"0px;")+"border-color:"+i+";border-style: solid;}.ast-builder-menu-mobile .main-navigation .main-header-menu{")+"border-top-width:"+(!0===e?n+"px;":"0px;")+"border-style: solid;")+"border-color:"+i+";}",astra_add_dynamic_css("header-mobile-menu-submenu-item-border",t)):wp.customize.preview.send("refresh")})}),astra_css("astra-settings[header-mobile-menu-submenu-b-color]","border-color",e+" li.menu-item .sub-menu, "+e+" .main-header-menu"),astra_color_responsive_css("astra-builder-transparent-submenu","astra-settings[transparent-submenu-h-color-responsive]","color",".ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link")}(jQuery); assets/js/unminified/customizer-preview.js 0000644 00000041074 15051510473 0015041 0 ustar 00 /**
* This file adds some LIVE to the Customizer live preview. To leverage
* this, set your custom settings to 'postMessage' and then add your handling
* here. Your javascript should grab settings from customizer controls, and
* then make any necessary changes to the page using jQuery.
*
* @package Astra
* @since 3.0.0
*/
( function( $ ) {
var tablet_break_point = AstraBuilderMenuData.tablet_break_point || 768,
mobile_break_point = AstraBuilderMenuData.mobile_break_point || 544;
var selector = '.ast-builder-menu-mobile .main-navigation';
var section = 'section-header-mobile-menu';
// Advanced Visibility CSS Generation.
astra_builder_visibility_css( section, selector, 'block' );
/**
* Typography CSS.
*/
// Menu Typography.
astra_generate_outside_font_family_css(
'astra-settings[header-mobile-menu-font-family]',
selector + ' .menu-item > .menu-link'
);
astra_generate_font_weight_css(
'astra-settings[header-mobile-menu-font-family]',
'astra-settings[header-mobile-menu-font-weight]',
'font-weight',
selector + ' .menu-item > .menu-link'
);
astra_responsive_font_size(
'astra-settings[header-mobile-menu-font-size]',
selector + ' .menu-item > .menu-link'
);
astra_font_extras_css( 'font-extras-header-mobile-menu', '.ast-builder-menu-mobile .main-navigation .menu-item > .menu-link' );
/**
* Color CSS.
*/
/**
* Menu - Colors
*/
// Menu - Normal Color
astra_color_responsive_css(
'astra-menu-color-preview',
'astra-settings[header-mobile-menu-color-responsive]',
'color',
selector + ' .main-header-menu .menu-item > .menu-link'
);
// Menu - Hover Color
astra_color_responsive_css(
'astra-menu-h-color-preview',
'astra-settings[header-mobile-menu-h-color-responsive]',
'color',
selector + ' .menu-item:hover > .menu-link, ' + selector + ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle'
);
// Menu Toggle - Color
astra_color_responsive_css(
'astra-builder-toggle',
'astra-settings[header-mobile-menu-color-responsive]',
'color',
selector + ' .menu-item > .ast-menu-toggle'
);
// Menu Toggle - Hover Color
astra_color_responsive_css(
'astra-menu-h-toogle-color-preview',
'astra-settings[header-mobile-menu-h-color-responsive]',
'color',
selector + ' .menu-item:hover > .ast-menu-toggle'
);
// Menu - Active Color
astra_color_responsive_css(
'astra-menu-active-color-preview',
'astra-settings[header-mobile-menu-a-color-responsive]',
'color',
selector + ' .menu-item.current-menu-item > .menu-link, ' + selector + ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle'
);
// Menu - Normal Background
astra_apply_responsive_background_css( 'astra-settings[header-mobile-menu-bg-obj-responsive]', selector + ' .main-header-menu, ' + selector + ' .main-header-menu .sub-menu', 'desktop' );
astra_apply_responsive_background_css( 'astra-settings[header-mobile-menu-bg-obj-responsive]', selector + ' .main-header-menu, ' + selector + ' .main-header-menu .sub-menu', 'tablet' );
astra_apply_responsive_background_css( 'astra-settings[header-mobile-menu-bg-obj-responsive]', selector + ' .main-header-menu, ' + selector + ' .main-header-menu .sub-menu', 'mobile' );
// Menu - Hover Background
astra_color_responsive_css(
'astra-menu-bg-preview',
'astra-settings[header-mobile-menu-h-bg-color-responsive]',
'background',
selector + ' .menu-item:hover > .menu-link, ' + selector + ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle'
);
// Menu - Active Background
astra_color_responsive_css(
'astra-builder',
'astra-settings[header-mobile-menu-a-bg-color-responsive]',
'background',
selector + ' .menu-item.current-menu-item > .menu-link, ' + selector + ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle'
);
/**
* Border CSS.
*/
(function () {
// Sub Menu - Divider Size.
wp.customize( 'astra-settings[header-mobile-menu-submenu-item-b-size]', function( value ) {
value.bind( function( borderSize ) {
var selector = '.ast-hfb-header .ast-builder-menu-mobile .main-navigation';
var dynamicStyle = '';
dynamicStyle += selector + ' .main-header-menu {';
dynamicStyle += 'border-top-width: ' + borderSize + 'px;';
dynamicStyle += '} ';
dynamicStyle += selector + ' .menu-item .sub-menu .menu-link, ' + selector + ' .menu-item .menu-link {';
dynamicStyle += 'border-bottom-width: ' + borderSize + 'px;';
dynamicStyle += '} ';
astra_add_dynamic_css( 'header-mobile-menu-submenu-item-b-size', dynamicStyle );
} );
} );
// Menu 1 > Sub Menu Border Size.
wp.customize( 'astra-settings[header-mobile-menu-submenu-border]', function( setting ) {
setting.bind( function( border ) {
var dynamicStyle = '.ast-builder-menu-mobile .sub-menu {';
dynamicStyle += 'border-top-width:' + border.top + 'px;';
dynamicStyle += 'border-right-width:' + border.right + 'px;';
dynamicStyle += 'border-left-width:' + border.left + 'px;';
dynamicStyle += 'border-style: solid;';
dynamicStyle += 'border-bottom-width:' + border.bottom + 'px;';
dynamicStyle += '}';
astra_add_dynamic_css( 'header-mobile-menu-submenu-border', dynamicStyle );
} );
} );
// Menu Spacing - Menu 1.
wp.customize( 'astra-settings[header-mobile-menu-menu-spacing]', function( value ) {
value.bind( function( padding ) {
var dynamicStyle = '';
dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {';
dynamicStyle += 'padding-left: ' + padding['desktop']['left'] + padding['desktop-unit'] + ';';
dynamicStyle += 'padding-right: ' + padding['desktop']['right'] + padding['desktop-unit'] + ';';
dynamicStyle += 'padding-top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';';
dynamicStyle += 'padding-bottom: ' + padding['desktop']['bottom'] + padding['desktop-unit'] + ';';
dynamicStyle += '} ';
// Toggle top.
dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {';
dynamicStyle += 'top: ' + padding['desktop']['top'] + padding['desktop-unit'] + ';';
dynamicStyle += 'right: calc( ' + padding['desktop']['right'] + padding['desktop-unit'] + ' - 0.907em );'
dynamicStyle += '} ';
dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
dynamicStyle += '.ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {';
dynamicStyle += 'padding-left: ' + padding['tablet']['left'] + padding['tablet-unit'] + ';';
dynamicStyle += 'padding-right: ' + padding['tablet']['right'] + padding['tablet-unit'] + ';';
dynamicStyle += 'padding-top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';';
dynamicStyle += 'padding-bottom: ' + padding['tablet']['bottom'] + padding['tablet-unit'] + ';';
dynamicStyle += '} ';
// Toggle top.
dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {';
dynamicStyle += 'top: ' + padding['tablet']['top'] + padding['tablet-unit'] + ';';
dynamicStyle += 'right: calc( ' + padding['tablet']['right'] + padding['tablet-unit'] + ' - 0.907em );'
dynamicStyle += '} ';
dynamicStyle += '} ';
dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
dynamicStyle += '.ast-header-break-point .ast-builder-menu-mobile .main-header-menu .menu-item > .menu-link {';
dynamicStyle += 'padding-left: ' + padding['mobile']['left'] + padding['mobile-unit'] + ';';
dynamicStyle += 'padding-right: ' + padding['mobile']['right'] + padding['mobile-unit'] + ';';
dynamicStyle += 'padding-top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';';
dynamicStyle += 'padding-bottom: ' + padding['mobile']['bottom'] + padding['mobile-unit'] + ';';
dynamicStyle += '} ';
// Toggle top.
dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation ul .menu-item.menu-item-has-children > .ast-menu-toggle {';
dynamicStyle += 'top: ' + padding['mobile']['top'] + padding['mobile-unit'] + ';';
dynamicStyle += 'right: calc( ' + padding['mobile']['right'] + padding['mobile-unit'] + ' - 0.907em );'
dynamicStyle += '} ';
dynamicStyle += '} ';
astra_add_dynamic_css( 'header-mobile-menu-menu-spacing-toggle-button', dynamicStyle );
} );
} );
// Margin - Menu 1.
wp.customize( 'astra-settings[section-header-mobile-menu-margin]', function( value ) {
value.bind( function( margin ) {
var selector = '.ast-builder-menu-mobile .main-header-menu, .ast-header-break-point .ast-builder-menu-mobile .main-header-menu';
var dynamicStyle = '';
dynamicStyle += selector + ' {';
dynamicStyle += 'margin-left: ' + margin['desktop']['left'] + margin['desktop-unit'] + ';';
dynamicStyle += 'margin-right: ' + margin['desktop']['right'] + margin['desktop-unit'] + ';';
dynamicStyle += 'margin-top: ' + margin['desktop']['top'] + margin['desktop-unit'] + ';';
dynamicStyle += 'margin-bottom: ' + margin['desktop']['bottom'] + margin['desktop-unit'] + ';';
dynamicStyle += '} ';
dynamicStyle += '@media (max-width: ' + tablet_break_point + 'px) {';
dynamicStyle += selector + ' {';
dynamicStyle += 'margin-left: ' + margin['tablet']['left'] + margin['tablet-unit'] + ';';
dynamicStyle += 'margin-right: ' + margin['tablet']['right'] + margin['tablet-unit'] + ';';
dynamicStyle += 'margin-top: ' + margin['tablet']['top'] + margin['desktop-unit'] + ';';
dynamicStyle += 'margin-bottom: ' + margin['tablet']['bottom'] + margin['desktop-unit'] + ';';
dynamicStyle += '} ';
dynamicStyle += '} ';
dynamicStyle += '@media (max-width: ' + mobile_break_point + 'px) {';
dynamicStyle += selector + ' {';
dynamicStyle += 'margin-left: ' + margin['mobile']['left'] + margin['mobile-unit'] + ';';
dynamicStyle += 'margin-right: ' + margin['mobile']['right'] + margin['mobile-unit'] + ';';
dynamicStyle += 'margin-top: ' + margin['mobile']['top'] + margin['desktop-unit'] + ';';
dynamicStyle += 'margin-bottom: ' + margin['mobile']['bottom'] + margin['desktop-unit'] + ';';
dynamicStyle += '} ';
dynamicStyle += '} ';
astra_add_dynamic_css( 'section-header-mobile-menu-margin', dynamicStyle );
} );
} );
/**
* Header Menu 1 > Submenu border Color
*/
wp.customize('astra-settings[header-mobile-menu-submenu-item-b-color]', function (value) {
value.bind(function (color) {
var insideBorder = wp.customize('astra-settings[header-mobile-menu-submenu-item-border]').get(),
borderSize = wp.customize('astra-settings[header-mobile-menu-submenu-item-b-size]').get();
if ('' != color) {
if ( true == insideBorder ) {
var dynamicStyle = '';
dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .menu-link';
dynamicStyle += '{';
dynamicStyle += 'border-bottom-width:' + ( ( true === insideBorder ) ? borderSize + 'px;' : '0px;' );
dynamicStyle += 'border-color:' + color + ';';
dynamicStyle += 'border-style: solid;';
dynamicStyle += '}';
dynamicStyle += '.ast-hfb-header .ast-builder-menu-mobile .main-navigation .main-header-menu';
dynamicStyle += '{';
dynamicStyle += 'border-top-width:' + ( ( true === insideBorder ) ? borderSize + 'px;' : '0px;' );
dynamicStyle += 'border-color:' + color + ';';
dynamicStyle += '}';
astra_add_dynamic_css('header-mobile-menu-submenu-item-b-color', dynamicStyle);
} else {
wp.customize.preview.send( 'refresh' );
}
} else {
wp.customize.preview.send('refresh');
}
});
});
/**
* Header Menu 1 > Submenu border Color
*/
wp.customize( 'astra-settings[header-mobile-menu-submenu-item-border]', function( value ) {
value.bind( function( border ) {
var color = wp.customize( 'astra-settings[header-mobile-menu-submenu-item-b-color]' ).get(),
borderSize = wp.customize('astra-settings[header-mobile-menu-submenu-item-b-size]').get();
if( true === border ) {
var dynamicStyle = '.ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .sub-menu .menu-link, .ast-builder-menu-mobile .main-navigation .main-header-menu .menu-item .menu-link';
dynamicStyle += '{';
dynamicStyle += 'border-bottom-width:' + ( ( true === border ) ? borderSize + 'px;' : '0px;' );
dynamicStyle += 'border-color:' + color + ';';
dynamicStyle += 'border-style: solid;';
dynamicStyle += '}';
dynamicStyle += '.ast-builder-menu-mobile .main-navigation .main-header-menu';
dynamicStyle += '{';
dynamicStyle += 'border-top-width:' + ( ( true === border ) ? borderSize + 'px;' : '0px;' );
dynamicStyle += 'border-style: solid;';
dynamicStyle += 'border-color:' + color + ';';
dynamicStyle += '}';
astra_add_dynamic_css( 'header-mobile-menu-submenu-item-border', dynamicStyle );
} else {
wp.customize.preview.send( 'refresh' );
}
} );
} );
})();
// Sub Menu - Border Color.
astra_css(
'astra-settings[header-mobile-menu-submenu-b-color]',
'border-color',
selector + ' li.menu-item .sub-menu, ' + selector + ' .main-header-menu'
);
// Transparent header > Submenu link hover color.
astra_color_responsive_css( 'astra-builder-transparent-submenu', 'astra-settings[transparent-submenu-h-color-responsive]', 'color', '.ast-theme-transparent-header .main-header-menu .menu-item .sub-menu .menu-item:hover > .menu-link' );
} )( jQuery );
dynamic-css/dynamic.css.php 0000644 00000036656 15051510473 0011723 0 ustar 00 .menu-link' => astra_get_font_array_css( astra_get_option( 'header-mobile-menu-font-family' ), astra_get_option( 'header-mobile-menu-font-weight' ), array(), 'font-extras-header-mobile-menu' ),
$selector => array(
'font-size' => astra_get_font_css_value( $menu_font_size_desktop, $menu_font_size_desktop_unit ),
),
$selector . ' .main-header-menu .menu-item > .menu-link' => array(
'color' => $menu_resp_color_desktop,
'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'desktop' ),
'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'desktop' ),
'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'desktop' ),
'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ),
),
$selector . ' .main-header-menu .menu-item > .ast-menu-toggle' => array(
'color' => $menu_resp_color_desktop,
),
$selector . ' .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array(
'color' => $menu_resp_color_hover_desktop,
'background' => $menu_resp_bg_color_hover_desktop,
),
$selector . ' .menu-item:hover > .ast-menu-toggle' => array(
'color' => $menu_resp_color_hover_desktop,
),
$selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .menu-item.current-menu-ancestor > .menu-link, ' . $selector . ' .menu-item.current-menu-ancestor > .ast-menu-toggle' => array(
'color' => $menu_resp_color_active_desktop,
'background' => $menu_resp_bg_color_active_desktop,
),
$selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array(
'color' => $menu_resp_color_active_desktop,
),
$selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array(
'top' => $menu_spacing_desktop_top,
'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ), '-', '0.907', 'em' ),
),
$selector . ' .menu-item-has-children > .menu-link:after' => array(
'content' => 'unset',
),
// Margin CSS.
$margin_selector => array(
'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ),
'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ),
'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ),
'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ),
),
);
$css_output_desktop[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'desktop' );
$css_output_tablet = array(
$selector => array(
'font-size' => astra_get_font_css_value( $menu_font_size_tablet, $menu_font_size_tablet_unit ),
),
$selector . ' .main-header-menu .menu-item > .menu-link' => array(
'color' => $menu_resp_color_tablet,
'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'tablet' ),
'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'tablet' ),
'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'tablet' ),
'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'tablet' ),
),
$selector . ' .menu-item > .ast-menu-toggle' => array(
'color' => $menu_resp_color_tablet,
),
$selector . ' .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array(
'color' => $menu_resp_color_hover_tablet,
'background' => $menu_resp_bg_color_hover_tablet,
),
$selector . ' .menu-item:hover > .ast-menu-toggle' => array(
'color' => $menu_resp_color_hover_tablet,
),
$selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .menu-item.current-menu-ancestor > .menu-link, ' . $selector . ' .menu-item.current-menu-ancestor > .ast-menu-toggle' => array(
'color' => $menu_resp_color_active_tablet,
'background' => $menu_resp_bg_color_active_tablet,
),
$selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array(
'color' => $menu_resp_color_active_tablet,
),
$selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array(
'top' => $menu_spacing_tablet_top,
'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'tablet' ), '-', '0.907', 'em' ),
),
$selector . ' .menu-item-has-children > .menu-link:after' => array(
'content' => 'unset',
),
// Margin CSS.
$margin_selector => array(
'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ),
'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ),
'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ),
'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ),
),
);
$css_output_tablet[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'tablet' );
$css_output_mobile = array(
$selector => array(
'font-size' => astra_get_font_css_value( $menu_font_size_mobile, $menu_font_size_mobile_unit ),
),
$selector . ' .main-header-menu .menu-item > .menu-link' => array(
'color' => $menu_resp_color_mobile,
'padding-top' => astra_responsive_spacing( $menu_spacing, 'top', 'mobile' ),
'padding-bottom' => astra_responsive_spacing( $menu_spacing, 'bottom', 'mobile' ),
'padding-left' => astra_responsive_spacing( $menu_spacing, 'left', 'mobile' ),
'padding-right' => astra_responsive_spacing( $menu_spacing, 'right', 'mobile' ),
),
$selector . ' .menu-item > .ast-menu-toggle' => array(
'color' => $menu_resp_color_mobile,
),
$selector . ' .menu-item:hover > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item:hover > .ast-menu-toggle' => array(
'color' => $menu_resp_color_hover_mobile,
'background' => $menu_resp_bg_color_hover_mobile,
),
$selector . ' .menu-item:hover > .ast-menu-toggle' => array(
'color' => $menu_resp_color_hover_mobile,
),
$selector . ' .menu-item.current-menu-item > .menu-link, ' . $selector . ' .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, ' . $selector . ' .menu-item.current-menu-ancestor > .menu-link, ' . $selector . ' .menu-item.current-menu-ancestor > .ast-menu-toggle' => array(
'color' => $menu_resp_color_active_mobile,
'background' => $menu_resp_bg_color_active_mobile,
),
$selector . ' .menu-item.current-menu-item > .ast-menu-toggle' => array(
'color' => $menu_resp_color_active_mobile,
),
$selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' => array(
'top' => $menu_spacing_mobile_top,
'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'mobile' ), '-', '0.907', 'em' ),
),
// Margin CSS.
$margin_selector => array(
'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ),
'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ),
'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ),
'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ),
),
);
$css_output_mobile[ $selector . ' .main-header-menu, ' . $selector . ' .main-header-menu .sub-menu' ] = astra_get_responsive_background_obj( $menu_resp_bg_color, 'mobile' );
if ( true === $sub_menu_divider_toggle ) {
$css_output_desktop_submenu = array(
'.ast-hfb-header ' . $selector . ' .main-header-menu, .ast-hfb-header ' . $selector . ' .main-header-menu, .ast-hfb-header .ast-mobile-header-content ' . $selector . ' .main-header-menu, .ast-hfb-header .ast-mobile-popup-content ' . $selector . ' .main-header-menu' => array(
'border-top-width' => $sub_menu_divider_size . 'px',
'border-color' => $sub_menu_divider_color,
),
'.ast-hfb-header ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header ' . $selector . ' .menu-item .menu-link, .ast-hfb-header ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header ' . $selector . ' .menu-item .menu-link, .ast-hfb-header .ast-mobile-header-content ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-mobile-header-content ' . $selector . ' .menu-item .menu-link, .ast-hfb-header .ast-mobile-popup-content ' . $selector . ' .menu-item .sub-menu .menu-link, .ast-hfb-header .ast-mobile-popup-content ' . $selector . ' .menu-item .menu-link' => array(
'border-bottom-width' => $sub_menu_divider_size . 'px',
'border-color' => $sub_menu_divider_color,
'border-style' => 'solid',
),
);
} else {
$css_output_desktop_submenu = array(
'.ast-hfb-header .ast-builder-menu-mobile .main-header-menu, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .menu-link, .ast-hfb-header .ast-builder-menu-mobile .main-navigation .menu-item .sub-menu .menu-link' => array(
'border-style' => 'none',
),
);
}
$css_output_desktop_submenu[ $selector . ' .menu-item.menu-item-has-children > .ast-menu-toggle' ] = array(
'top' => $menu_spacing_desktop_top,
'right' => astra_calculate_spacing( astra_responsive_spacing( $menu_spacing, 'right', 'desktop' ), '-', '0.907', 'em' ),
);
$css_output = astra_parse_css( $css_output_desktop );
$css_output .= astra_parse_css( $css_output_desktop_submenu );
$css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() );
$css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() );
$dynamic_css .= $css_output;
$dynamic_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $selector, 'block' );
return $dynamic_css;
}