add_panel( $panel , array( 'title' => esc_html__( 'Top Bar', 'aces' ), 'priority' => 20, ) ); // Path $dir = ACES_THEME_DIR . 'inc/customizer/settings/'; // Load customize control classes require_once( $dir . 'topbar/layout.php'); require_once( $dir . 'topbar/content.php'); require_once( $dir . 'topbar/menu.php'); require_once( $dir . 'topbar/social.php'); } /** * Get CSS * * @since 1.0.0 */ public static function aces_head_css( $output ) { //layout $top_padding = get_theme_mod( 'aces_theme_topbar_top_padding' ); $right_padding = get_theme_mod( 'aces_theme_topbar_right_padding' ); $bottom_padding = get_theme_mod( 'aces_theme_topbar_bottom_padding' ); $left_padding = get_theme_mod( 'aces_theme_topbar_left_padding'); $tablet_top_padding = get_theme_mod( 'aces_theme_topbar_tablet_top_padding' ); $tablet_right_padding = get_theme_mod( 'aces_theme_topbar_tablet_right_padding' ); $tablet_bottom_padding = get_theme_mod( 'aces_theme_topbar_tablet_bottom_padding' ); $tablet_left_padding = get_theme_mod( 'aces_theme_topbar_tablet_left_padding' ); $mobile_top_padding = get_theme_mod( 'aces_theme_topbar_mobile_top_padding' ); $mobile_right_padding = get_theme_mod( 'aces_theme_topbar_mobile_right_padding' ); $mobile_bottom_padding = get_theme_mod( 'aces_theme_topbar_mobile_bottom_padding' ); $mobile_left_padding = get_theme_mod( 'aces_theme_topbar_mobile_left_padding' ); $background = get_theme_mod( 'aces_theme_topbar_bg_color', '#ffffff' ); $border_color = get_theme_mod( 'aces_topbar_border_color', '#ebebeb ' ); // content $text_color = get_theme_mod( 'aces_topbar_contnt_text_color', '#969696' ); $link_color = get_theme_mod( 'aces_topbar_contnt_link_color' ); $link_color_hover = get_theme_mod( 'aces_topbar_contnt_link_hover_color', '#262626' ); // menu $menu_text_color = get_theme_mod( 'aces_topbar_menu_text_color', '#969696' ); $menu_text_hover_color = get_theme_mod( 'aces_topbar_menu_hover_text_color' ); // social $aocial_icon_color = get_theme_mod( 'aces_topbar_social_icon_color', '#969696' ); $social_icon_hover_color = get_theme_mod( 'aces_topbar_social_icon_hover_color', '#262626' ); $social_border_color = get_theme_mod( 'aces_topbar_social_border_color', '#ebebeb' ); // Define css var $css = ''; // Top bar padding if ( isset( $top_padding ) && '' != $top_padding && '' != $top_padding || isset( $right_padding ) && '' != $right_padding && '' != $right_padding || isset( $bottom_padding ) && '' != $bottom_padding && '' != $bottom_padding || isset( $left_padding ) && '' != $left_padding && '' != $left_padding ) { $css .= '.top-bar{padding:'. aces_spacing_css( $top_padding, $right_padding, $bottom_padding, $left_padding ) .'}'; } // Tablet top bar padding if ( isset( $tablet_top_padding ) && '' != $tablet_top_padding || isset( $tablet_right_padding ) && '' != $tablet_right_padding || isset( $tablet_bottom_padding ) && '' != $tablet_bottom_padding || isset( $tablet_left_padding ) && '' != $tablet_left_padding ) { $css .= '@media (max-width: 768px){.top-bar{padding:'. aces_spacing_css( $tablet_top_padding, $tablet_right_padding, $tablet_bottom_padding, $tablet_left_padding ) .'}}'; } // Mobile top bar padding if ( isset( $mobile_top_padding ) && '' != $mobile_top_padding || isset( $mobile_right_padding ) && '' != $mobile_right_padding || isset( $mobile_bottom_padding ) && '' != $mobile_bottom_padding || isset( $mobile_left_padding ) && '' != $mobile_left_padding ) { $css .= '@media (max-width: 480px){.top-bar{padding:'. aces_spacing_css( $mobile_top_padding, $mobile_right_padding, $mobile_bottom_padding, $mobile_left_padding ) .'}}'; } // layout if ( ! empty( $background ) && '#ffffff' != $background ) { $css .= '.top-bar{background-color:'. $background .';}'; } if ( ! empty( $border_color ) && '#ebebeb' != $border_color ) { $css .= '.top-bar{border-bottom:1px solid'. $border_color .';}'; } // content if ( ! empty( $text_color ) && '#969696' != $text_color ) { $css .= '.top-bar .top-text, .top-bar .top-text *{color:'. $text_color .';}'; } if ( ! empty( $link_color ) ) { $css .= '.top-bar .top-text a{color:'. $link_color .' !important;}'; } if ( ! empty( $link_color_hover ) && '#262626' != $link_color_hover ) { $css .= '.top-bar .top-text a:hover{color:'. $link_color_hover .' !important;}'; } // menu if ( ! empty( $menu_text_color ) && '#969696' != $menu_text_color ) { $css .= '.top-navigation ul li a{color:'. $menu_text_color .';}'; } if ( ! empty( $menu_text_hover_color )) { $css .= '.top-navigation ul li a:hover{color:'. $menu_text_hover_color .';}'; } // social if ( ! empty( $social_icon_color ) && '#969696' != $social_icon_color ) { $css .= '.aces-social a{color:'. $social_icon_color .';}'; } if ( ! empty( $social_icon_hover_color ) && '#262626' != $social_icon_hover_color ) { $css .= '.aces-social a:hover{color:'. $social_icon_hover_color .';}'; } if ( ! empty( $social_border_color ) && '#ebebeb' != $social_border_color ) { $css .= '.aces-social a{border-left: 1px solid'. $social_border_color .';}'; $css .= '.aces-social a:last-child{border-right: 1px solid'. $social_border_color .';}'; } // Return CSS if ( ! empty( $css ) ) { $output .= '/* Top Bar CSS */'. $css; } // Return output css return $output; } } endif; return new Aces_Top_Bar_Customizer();