Astra_Elementor::enqueue_elementor_compatibility_styles( string $dynamic_css, string $dynamic_css_filtered = '' )

Compatibility CSS for Elementor Headings after Elementor-v2.9.9


Description

In v2.9.9 Elementor has removed [ .elementor-widget-heading .elementor-heading-title { margin: 0 } ] this CSS. Again in v2.9.10 Elementor added this as .elementor-heading-title { margin: 0 } but still our [ .entry-content heading { margin-bottom: 20px } ] CSS overrding their fix.

That’s why adding this CSS fix to headings by setting bottom-margin to 0.


Parameters

$dynamic_css

(string) (Required) Astra Dynamic CSS.

$dynamic_css_filtered

(string) (Optional) Astra Dynamic CSS Filters.

Default value: ''


Return

(string) $dynamic_css Generated CSS.


Source

File: inc/compatibility/class-astra-elementor.php

		public function enqueue_elementor_compatibility_styles( $dynamic_css, $dynamic_css_filtered = '' ) {

			global $post;
			$id = astra_get_post_id();

			if ( $this->is_elementor_activated( $id ) ) {

				$elementor_heading_margin_comp = array(
					'.elementor-widget-heading .elementor-heading-title' => array(
						'margin' => '0',
					),
				);

				/* Parse CSS from array() */
				$parse_css = astra_parse_css( $elementor_heading_margin_comp );

				$elementor_base_css = array(
					'.elementor-post.elementor-grid-item.hentry' => array(
						'margin-bottom' => '0',
					),
					'.woocommerce div.product .elementor-element.elementor-products-grid .related.products ul.products li.product, .elementor-element .elementor-wc-products .woocommerce[class*=\'columns-\'] ul.products li.product' => array(
						'width'  => 'auto',
						'margin' => '0',
						'float'  => 'none',
					),
				);

				if ( astra_can_remove_elementor_toc_margin_space() ) {
					$elementor_base_css['.elementor-toc__list-wrapper'] = array(
						'margin' => 0,
					);
				}

				// Load base static CSS when Elmentor is activated.
				$parse_css .= astra_parse_css( $elementor_base_css );

				if ( is_rtl() ) {
					$elementor_rtl_support_css = array(
						'.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array(
							'max-width' => '100%',
							'right'     => '0 !important',
						),
					);
				} else {
					$elementor_rtl_support_css = array(
						'.ast-left-sidebar .elementor-section.elementor-section-stretched,.ast-right-sidebar .elementor-section.elementor-section-stretched' => array(
							'max-width' => '100%',
							'left'      => '0 !important',
						),
					);
				}
				$parse_css .= astra_parse_css( $elementor_rtl_support_css );


				$dynamic_css .= $parse_css;
			}

			$elementor_archive_page_css = array(
				'.elementor-template-full-width .ast-container' => array(
					'display' => 'block',
				),
			);
			$dynamic_css               .= astra_parse_css( $elementor_archive_page_css );

			$dynamic_css .= astra_parse_css(
				array(
					'.elementor-element .elementor-wc-products .woocommerce[class*="columns-"] ul.products li.product' => array(
						'width'  => 'auto',
						'margin' => '0',
					),
					'.elementor-element .woocommerce .woocommerce-result-count' => array(
						'float' => 'none',
					),
				),
				'',
				astra_get_mobile_breakpoint()
			);

			return $dynamic_css;
		}

Changelog

Changelog
Version Description
2.4.5 Introduced.

User Contributed Notes

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