Astra_Elementor::generate_global_elementor_style( string $dynamic_css )

Generate CSS variable style for Elementor.


Description


Parameters

$dynamic_css

(string) (Required) Dynamic CSS.


Return

(object)


Source

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

		public function generate_global_elementor_style( $dynamic_css ) {

			$global_palette = astra_get_option( 'global-color-palette' );
			$palette_style  = array();
			$slugs          = Astra_Global_Palette::get_palette_slugs();
			$style          = array();

			if ( isset( $global_palette['palette'] ) ) {
				foreach ( $global_palette['palette'] as $color_index => $color ) {
					$variable_key           = '--e-global-color-' . str_replace( '-', '', $slugs[ $color_index ] );
					$style[ $variable_key ] = $color;
				}

				$palette_style[':root'] = $style;
				$dynamic_css           .= astra_parse_css( $palette_style );
			}

			return $dynamic_css;
		}

Changelog

Changelog
Version Description
3.7.0 Introduced.

User Contributed Notes

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