astra_ext_mobile_header_spacing_dynamic_css( string $dynamic_css, string $dynamic_css_filtered = '' )

Deprecating astra_ext_mobile_header_spacing_dynamic_css function.


Description

Astra’s old header mobile layout spacing specific dynamic CSS.

See also


Parameters

$dynamic_css

(string) (Required) Astra Dynamic CSS.

$dynamic_css_filtered

(string) (Optional) Astra Dynamic CSS Filters.

Default value: ''


Return

(string)


Source

File: classes/deprecated/deprecated-functions.php

function astra_ext_mobile_header_spacing_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {

	$menu_style           = astra_get_option( 'mobile-menu-style' );
	$primary_menu_spacing = astra_get_option( 'primary-menu-spacing' );

	$header_spacing = astra_get_option( 'header-spacing' );

	$css_output = '';

	/**
	 * Responsive Colors options
	 * [4]. Below Header Menu Responsive Colors only for No Toggle menu style
	 */
	if ( 'no-toggle' == $menu_style ) {
		if ( $primary_menu_spacing ) {
			$desktop_spacing = array(
				'.ast-no-toggle-menu-enable.ast-header-break-point .main-header-bar .main-header-menu > .menu-item-has-children > .ast-menu-toggle' => array(
					'padding-left'  => astra_responsive_spacing( $primary_menu_spacing, 'left', 'desktop' ),
					'padding-right' => astra_responsive_spacing( $primary_menu_spacing, 'right', 'desktop' ),
				),
			);
			$tablet_spacing  = array(
				'.ast-no-toggle-menu-enable.ast-header-break-point .main-header-bar .main-header-menu > .menu-item-has-children > .ast-menu-toggle' => array(
					'padding-left'  => astra_responsive_spacing( $primary_menu_spacing, 'left', 'tablet' ),
					'padding-right' => astra_responsive_spacing( $primary_menu_spacing, 'right', 'tablet' ),
				),
			);
			$mobile_spacing  = array(
				'.ast-no-toggle-menu-enable.ast-header-break-point .main-header-bar .main-header-menu > .menu-item-has-children > .ast-menu-toggle' => array(
					'padding-left'  => astra_responsive_spacing( $primary_menu_spacing, 'left', 'mobile' ),
					'padding-right' => astra_responsive_spacing( $primary_menu_spacing, 'right', 'mobile' ),
				),
			);
			$css_output     .= astra_parse_css( $desktop_spacing );
			$css_output     .= astra_parse_css( $tablet_spacing, '', astra_addon_get_tablet_breakpoint() );
			$css_output     .= astra_parse_css( $mobile_spacing, '', astra_addon_get_mobile_breakpoint() );
		}
	}

	/**
	 * Spacing for .main-header-bar. when click on the toggle menu button
	 */

	$desktop_spacing = array(
		// Header Spacing Top / Bottom Padding.
		'.ast-flyout-menu-enable.ast-main-header-nav-open .main-header-bar,.ast-fullscreen-menu-enable.ast-main-header-nav-open .main-header-bar' => array(
			'padding-bottom' => astra_responsive_spacing( $header_spacing, 'bottom', 'desktop' ),
		),
	);
	$tablet_spacing  = array(
		// Header Spacing Top / Bottom Padding.
		'.ast-flyout-menu-enable.ast-main-header-nav-open .main-header-bar,.ast-fullscreen-menu-enable.ast-main-header-nav-open .main-header-bar' => array(
			'padding-bottom' => astra_responsive_spacing( $header_spacing, 'bottom', 'tablet' ),
		),
	);
	$mobile_spacing  = array(
		// Header Spacing Top / Bottom Padding.
		'.ast-flyout-menu-enable.ast-main-header-nav-open .main-header-bar,.ast-fullscreen-menu-enable.ast-main-header-nav-open .main-header-bar' => array(
			'padding-bottom' => astra_responsive_spacing( $header_spacing, 'bottom', 'mobile' ),
		),
	);
	/* Parse CSS from array() */
	$css_output .= astra_parse_css( $desktop_spacing );
	$css_output .= astra_parse_css( $tablet_spacing, '', astra_addon_get_tablet_breakpoint() );
	$css_output .= astra_parse_css( $mobile_spacing, '', astra_addon_get_mobile_breakpoint() );

	return $dynamic_css . $css_output;
}

Changelog

Changelog
Version Description
3.6.2 Introduced.


User Contributed Notes

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