array( // Typography. 'font-size' => astra_responsive_font( $button_font_size, 'desktop' ), ), /** * Button Colors. */ $selector . ' .ast-custom-button' => array( // Colors. 'color' => $button_color_desktop, 'background' => $button_bg_color_desktop, // Border. 'border-color' => $button_border_color_desktop, 'border-top-width' => astra_get_css_value( $button_border_width['top'], 'px' ), 'border-bottom-width' => astra_get_css_value( $button_border_width['bottom'], 'px' ), 'border-left-width' => astra_get_css_value( $button_border_width['left'], 'px' ), 'border-right-width' => astra_get_css_value( $button_border_width['right'], 'px' ), 'border-radius' => astra_get_css_value( $button_border_radius, 'px' ), ), // Hover Options. $selector . ' .ast-custom-button:hover' => array( 'color' => $button_h_color_desktop, 'background' => $button_bg_h_color_desktop, 'border-color' => $button_border_h_color_desktop, ), ); /** * Button CSS. */ $css_output_tablet = array( /** * Button font size. */ $selector . '[data-section*="section-' . $context . '-button-"] .ast-builder-button-wrap .ast-custom-button' => array( // Typography. 'font-size' => astra_responsive_font( $button_font_size, 'tablet' ), ), /** * Button Colors. */ $selector . ' .ast-custom-button' => array( // Typography. 'font-size' => astra_responsive_font( $button_font_size, 'tablet' ), // Colors. 'color' => $button_color_tablet, 'background' => $button_bg_color_tablet, 'border-color' => $button_border_color_tablet, ), // Hover Options. $selector . ' .ast-custom-button:hover' => array( 'color' => $button_h_color_tablet, 'background' => $button_bg_h_color_tablet, 'border-color' => $button_border_h_color_tablet, ), ); /** * Button CSS. */ $css_output_mobile = array( /** * Button font size. */ $selector . '[data-section*="section-' . $context . '-button-"] .ast-builder-button-wrap .ast-custom-button' => array( // Typography. 'font-size' => astra_responsive_font( $button_font_size, 'mobile' ), ), /** * Button Colors. */ $selector . ' .ast-custom-button' => array( // Typography. 'font-size' => astra_responsive_font( $button_font_size, 'mobile' ), // Colors. 'color' => $button_color_mobile, 'background' => $button_bg_color_mobile, 'border-color' => $button_border_color_mobile, ), // Hover Options. $selector . ' ..ast-custom-button:hover' => array( 'color' => $button_h_color_mobile, 'background' => $button_bg_h_color_mobile, 'border-color' => $button_border_h_color_mobile, ), ); /* Parse CSS from array() */ $css_output = astra_parse_css( $css_output_desktop ); $css_output .= astra_parse_css( $css_output_tablet, '', astra_get_tablet_breakpoint() ); $css_output .= astra_parse_css( $css_output_mobile, '', astra_get_mobile_breakpoint() ); $generated_css .= $css_output; $generated_css .= Astra_Builder_Base_Dynamic_CSS::prepare_advanced_margin_padding_css( $_section, $selector . '[data-section*="section-' . $context . '-button-"] .ast-builder-button-wrap .ast-custom-button' ); $visibility_selector = '.ast-' . $builder_type . '-button-' . $index . '[data-section="' . $_section . '"]'; $generated_css .= Astra_Builder_Base_Dynamic_CSS::prepare_visibility_css( $_section, $visibility_selector ); } if ( true === $hb_button_flag ) { $static_hb_css = array( '[data-section*="section-hb-button-"] .menu-link' => array( 'display' => 'none', ), ); return astra_parse_css( $static_hb_css ) . $generated_css; } return $generated_css; } } /** * Kicking this off by creating object of this class. */ new Astra_Button_Component_Dynamic_CSS();