From 9d4123cee1867ee7199b06bdc92d40611f547ecc Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 14:54:07 -0500 Subject: Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/. --- .../mobile-trigger/dynamic-css/dynamic.css.php | 184 +++++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 inc/builder/type/header/mobile-trigger/dynamic-css/dynamic.css.php (limited to 'inc/builder/type/header/mobile-trigger/dynamic-css') diff --git a/inc/builder/type/header/mobile-trigger/dynamic-css/dynamic.css.php b/inc/builder/type/header/mobile-trigger/dynamic-css/dynamic.css.php new file mode 100644 index 0000000..b7bbbbb --- /dev/null +++ b/inc/builder/type/header/mobile-trigger/dynamic-css/dynamic.css.php @@ -0,0 +1,184 @@ + array( + 'width' => astra_get_css_value( $icon_size, 'px' ), + 'height' => astra_get_css_value( $icon_size, 'px' ), + 'fill' => $icon_color, + ), + $selector . ' .ast-button-wrap .mobile-menu-wrap .mobile-menu' => array( + // Color. + 'color' => $icon_color, + + // Typography. + 'font-size' => astra_get_css_value( $font_size, 'px' ), + ), + $margin_selector => array( + // Margin CSS. + 'margin-top' => astra_responsive_spacing( $margin, 'top', 'desktop' ), + 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'desktop' ), + 'margin-left' => astra_responsive_spacing( $margin, 'left', 'desktop' ), + 'margin-right' => astra_responsive_spacing( $margin, 'right', 'desktop' ), + ), + ); + + // Execute all cases in customizer preview. + $is_customizer = false; + if ( is_customize_preview() ) { + $is_customizer = true; + } + switch ( $style ) { + case 'minimal': // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment + $css_output_minimal = array( + $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-minimal' => array( + // Color & Border. + 'color' => esc_attr( $icon_color ), + 'border' => 'none', + 'background' => 'transparent', + ), + ); + $dynamic_css .= astra_parse_css( $css_output_minimal ); + if ( false === $is_customizer ) { + break; + } + + case 'fill': // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment + $css_output_fill = array( + $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-fill' => array( + // Color & Border. + 'color' => esc_attr( $icon_color ), + 'border' => 'none', + 'background' => esc_attr( $trigger_bg ), + 'border-radius' => astra_get_css_value( $trigger_border_radius, 'px' ), + ), + ); + $dynamic_css .= astra_parse_css( $css_output_fill ); + if ( false === $is_customizer ) { + break; + } + + case 'outline': // phpcs:ignore PSR2.ControlStructures.SwitchDeclaration.TerminatingComment + $css_output_outline = array( + $selector . ' .ast-button-wrap .ast-mobile-menu-trigger-outline' => array( + 'background' => 'transparent', + 'color' => esc_attr( $icon_color ), + 'border-top-width' => astra_get_css_value( $trigger_border_width_top, 'px' ), + 'border-bottom-width' => astra_get_css_value( $trigger_border_width_bottom, 'px' ), + 'border-right-width' => astra_get_css_value( $trigger_border_width_right, 'px' ), + 'border-left-width' => astra_get_css_value( $trigger_border_width_left, 'px' ), + 'border-style' => 'solid', + 'border-color' => $trigger_border_color, + 'border-radius' => astra_get_css_value( $trigger_border_radius, 'px' ), + ), + ); + $dynamic_css .= astra_parse_css( $css_output_outline ); + if ( false === $is_customizer ) { + break; + } + + default: + $dynamic_css .= ''; + break; + + } + + // Tablet CSS. + $css_output_tablet = array( + + $margin_selector => array( + // Margin CSS. + 'margin-top' => astra_responsive_spacing( $margin, 'top', 'tablet' ), + 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'tablet' ), + 'margin-left' => astra_responsive_spacing( $margin, 'left', 'tablet' ), + 'margin-right' => astra_responsive_spacing( $margin, 'right', 'tablet' ), + ), + ); + + // Mobile CSS. + $css_output_mobile = array( + + $margin_selector => array( + // Margin CSS. + 'margin-top' => astra_responsive_spacing( $margin, 'top', 'mobile' ), + 'margin-bottom' => astra_responsive_spacing( $margin, 'bottom', 'mobile' ), + 'margin-left' => astra_responsive_spacing( $margin, 'left', 'mobile' ), + 'margin-right' => astra_responsive_spacing( $margin, 'right', 'mobile' ), + ), + ); + + /* Parse CSS from array() */ + $css_output = astra_parse_css( $css_output ); + $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); + $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); + + + $dynamic_css .= $css_output; + + return $dynamic_css; +} -- cgit v1.2.3-60-g2f50