Astra_Ext_Mobile_Header_Markup::add_styles()

Add Styles


Description


Return

(void)


Source

File: addons/mobile-header/classes/class-astra-ext-mobile-header-markup.php

		public function add_styles() {

			/*** Start Path Logic */

			/* Define Variables */
			$uri  = ASTRA_EXT_MOBILE_HEADER_URL . 'assets/css/';
			$path = ASTRA_EXT_MOBILE_HEADER_DIR . 'assets/css/';
			$rtl  = '';

			if ( is_rtl() ) {
				$rtl = '-rtl';
			}

			/* Directory and Extension */
			$file_prefix = $rtl . '.min';
			$dir_name    = 'minified';

			if ( SCRIPT_DEBUG ) {
				$file_prefix = $rtl;
				$dir_name    = 'unminified';
			}

			$css_uri = $uri . $dir_name . '/';
			$css_dir = $path . $dir_name . '/';

			if ( defined( 'ASTRA_THEME_HTTP2' ) && ASTRA_THEME_HTTP2 ) {
				$gen_path = $css_uri;
			} else {
				$gen_path = $css_dir;
			}

			/*** End Path Logic */

			/* Add style.css */
			$above_header_merged = astra_get_option( 'above-header-merge-menu' );
			$below_header_merged = astra_get_option( 'below-header-merge-menu' );

			$mobile_menu_style              = astra_get_option( 'mobile-menu-style' );
			$mobile_above_header_menu_style = astra_get_option( 'mobile-above-header-menu-style' );
			$mobile_below_header_menu_style = astra_get_option( 'mobile-below-header-menu-style' );

			if ( 'flyout' == $mobile_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'primary-menu-flyout' . $file_prefix . '.css' );
			}
			if ( 'no-toggle' == $mobile_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'primary-menu-no-toggle' . $file_prefix . '.css' );
			}
			if ( 'fullscreen' == $mobile_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'fullscreen-menu-common' . $file_prefix . '.css' );
				Astra_Minify::add_css( $gen_path . 'primary-menu-fullscreen' . $file_prefix . '.css' );
			}
			if ( 'flyout' == $mobile_above_header_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'above-menu-flyout' . $file_prefix . '.css' );
			}
			if ( ! $above_header_merged && 'no-toggle' == $mobile_above_header_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'above-menu-no-toggle' . $file_prefix . '.css' );
			}
			if ( 'fullscreen' == $mobile_above_header_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'fullscreen-menu-common' . $file_prefix . '.css' );
				Astra_Minify::add_css( $gen_path . 'above-menu-fullscreen' . $file_prefix . '.css' );
			}
			if ( 'flyout' == $mobile_below_header_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'below-menu-flyout' . $file_prefix . '.css' );
			}
			if ( ! $below_header_merged && 'no-toggle' == $mobile_below_header_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'below-menu-no-toggle' . $file_prefix . '.css' );
			}
			if ( 'fullscreen' == $mobile_below_header_menu_style ) {
				Astra_Minify::add_css( $gen_path . 'fullscreen-menu-common' . $file_prefix . '.css' );
				Astra_Minify::add_css( $gen_path . 'below-menu-fullscreen' . $file_prefix . '.css' );
			}
		}

Changelog

Changelog
Version Description
1.4.0 Introduced.


User Contributed Notes

You must log in before being able to contribute a note or feedback.