astra_addon_offcanvas_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) Generated dynamic CSS for Heading Colors.
Source
File: classes/builder/type/header/off-canvas/dynamic-css/dynamic.css.php
function astra_addon_offcanvas_dynamic_css( $dynamic_css, $dynamic_css_filtered = '' ) {
$selector = '.ast-mobile-popup-drawer.active';
$popup_width = astra_get_option( 'off-canvas-width' );
$popup_width_desktop = ( isset( $popup_width['desktop'] ) && ! empty( $popup_width['desktop'] ) ) ? $popup_width['desktop'] : '';
$popup_width_tablet = ( isset( $popup_width['tablet'] ) && ! empty( $popup_width['tablet'] ) ) ? $popup_width['tablet'] : '';
$popup_width_mobile = ( isset( $popup_width['mobile'] ) && ! empty( $popup_width['mobile'] ) ) ? $popup_width['mobile'] : '';
$css_output = array();
$css_output_tablet = array();
$css_output_mobile = array();
if ( ! empty( $popup_width_desktop ) ) {
$css_output[ '.ast-desktop ' . $selector . ' .ast-mobile-popup-inner' ]['max-width'] = $popup_width_desktop . '%';
}
if ( ! empty( $popup_width_tablet ) ) {
$css_output_tablet[ $selector . ' .ast-mobile-popup-inner' ]['max-width'] = $popup_width_tablet . '%';
}
if ( ! empty( $popup_width_mobile ) ) {
$css_output_mobile[ $selector . ' .ast-mobile-popup-inner' ]['max-width'] = $popup_width_mobile . '%';
}
$css_output = astra_parse_css( $css_output );
$css_output .= astra_parse_css( $css_output_tablet, '', astra_addon_get_tablet_breakpoint() );
$css_output .= astra_parse_css( $css_output_mobile, '', astra_addon_get_mobile_breakpoint() );
$dynamic_css .= $css_output;
return $dynamic_css;
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |