astra_below_header_builder_sections_dynamic_css( string $dynamic_css, string $dynamic_css_filtered = '' )
Dynamic CSS
Description
Parameters
- $dynamic_css
-
(string) (Required) Astra Dynamic CSS.
- $dynamic_css_filtered
-
(string) (Optional) Astra Dynamic CSS Filters.
Default value: ''
Return
(string)
Source
File: addons/sticky-header/classes/dynamic-css/header-sections-dynamic.css.php
function astra_below_header_builder_sections_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
/**
* Set colors
*
* If colors extension is_active then get color from it.
* Else set theme default colors.
*/
$stick_header = astra_get_option_meta( 'stick-header-meta' );
$stick_header_below_meta = astra_get_option_meta( 'header-below-stick-meta' );
$stick_header_below = astra_get_option( 'header-below-stick' );
$sticky_header_style = astra_get_option( 'sticky-header-style' );
$sticky_hide_on_scroll = astra_get_option( 'sticky-hide-on-scroll' );
/**
* Below Header.
*/
$desktop_sticky_below_header_bg_color = astra_get_prop( astra_get_option( 'sticky-below-header-bg-color-responsive' ), 'desktop', '#414042' );
$tablet_sticky_below_header_bg_color = astra_get_prop( astra_get_option( 'sticky-below-header-bg-color-responsive' ), 'tablet' );
$mobile_sticky_below_header_bg_color = astra_get_prop( astra_get_option( 'sticky-below-header-bg-color-responsive' ), 'mobile' );
if ( ! $stick_header_below && ( 'disabled' !== $stick_header && empty( $stick_header ) && ( empty( $stick_header_below_meta ) ) ) ) {
return $dynamic_css;
}
$parse_css = '';
/**
* Sticky Header
*
* [1]. Sticky Header Below colors options.
*/
/**
* Below Header.
*/
if ( 'none' === $sticky_header_style && ! $sticky_hide_on_scroll ) {
$desktop_below_header_css_output = array(
'.ast-below-sticky-header-active .ast-below-header-wrap .ast-below-header' => array(
'background' => esc_attr( $desktop_sticky_below_header_bg_color ),
),
);
$tablet_below_header_css_output = array(
'.ast-below-sticky-header-active .ast-below-header-wrap .ast-below-header' => array(
'background' => esc_attr( $tablet_sticky_below_header_bg_color ),
),
);
$mobile_below_header_css_output = array(
'.ast-below-sticky-header-active .ast-below-header-wrap .ast-below-header' => array(
'background' => esc_attr( $mobile_sticky_below_header_bg_color ),
),
);
} else {
// Only when Fixed Header Merkup added.
$desktop_below_header_css_output = array(
'#ast-fixed-header .ast-below-header' => array(
'background' => esc_attr( $desktop_sticky_below_header_bg_color ),
),
);
$tablet_below_header_css_output = array(
'#ast-fixed-header .ast-below-header' => array(
'background' => esc_attr( $tablet_sticky_below_header_bg_color ),
),
);
$mobile_below_header_css_output = array(
'#ast-fixed-header .ast-below-header' => array(
'background' => esc_attr( $mobile_sticky_below_header_bg_color ),
),
);
}
/* Parse CSS from array() */
$parse_css .= astra_parse_css( $desktop_below_header_css_output );
$parse_css .= astra_parse_css( $tablet_below_header_css_output, '', astra_addon_get_tablet_breakpoint() );
$parse_css .= astra_parse_css( $mobile_below_header_css_output, '', astra_addon_get_mobile_breakpoint() );
return $dynamic_css . $parse_css;
}
Expand full source code Collapse full source code View on Trac