packages/kirki-framework/module-css/src/Generator.php
public static function styles_parse( $css = [] ) {

		// Pass our styles from the kirki_styles_array filter.
		$css = apply_filters( 'kirki_styles_array', $css );

		// Process the array of CSS properties and produce the final CSS.
		$final_css = '';
		if ( ! is_array( $css ) || empty( $css ) ) {
			return '';
		}
		foreach ( $css as $media_query => $styles ) {
			$final_css .= ( 'global' !== $media_query ) ? $media_query . '{' : '';
			foreach ( $styles as $style => $style_array ) {
				$css_for_style = '';

				foreach ( $style_array as $property => $value ) {
					if ( is_string( $value ) && '' !== $value ) {
						$css_for_style .= $property . ':' . $value . ';';
					} elseif ( is_array( $value ) ) {
						foreach ( $value as $subvalue ) {
							if ( is_string( $subvalue ) && '' !== $subvalue ) {
								$css_for_style .= $property . ':' . $subvalue . ';';
							}
						}
					}
					$value = ( is_string( $value ) ) ? $value : '';
				}
				if ( '' !== $css_for_style ) {
					$final_css .= $style . '{' . $css_for_style . '}';
				}
			}
			$final_css .= ( 'global' !== $media_query ) ? '}' : '';
		}
		return $final_css;
	}
public static function styles_parse( $css = [] ) {

		// Pass our styles from the kirki_styles_array filter.
		$css = apply_filters( 'kirki_styles_array', $css );

		// Process the array of CSS properties and produce the final CSS.
		$final_css = '';
		if ( ! is_array( $css ) || empty( $css ) ) {
			return '';
		}
		foreach ( $css as $media_query => $styles ) {
			$final_css .= ( 'global' !== $media_query ) ? $media_query . '{' : '';
			foreach ( $styles as $style => $style_array ) {
				$css_for_style = '';

				foreach ( $style_array as $property => $value ) {
					if ( is_string( $value ) && '' !== $value ) {
						$css_for_style .= $property . ':' . $value . ';';
					} elseif ( is_array( $value ) ) {
						foreach ( $value as $subvalue ) {
							if ( is_string( $subvalue ) && '' !== $subvalue ) {
								$css_for_style .= $property . ':' . $subvalue . ';';
							}
						}
					}
					$value = ( is_string( $value ) ) ? $value : '';
				}
				if ( '' !== $css_for_style ) {
					$final_css .= $style . '{' . $css_for_style . '}';
				}
			}
			$final_css .= ( 'global' !== $media_query ) ? '}' : '';
		}
		return $final_css;
	}
public static function styles_parse ( $ css = [ ] ) { // Pass our styles from the kirki_styles_array filter. $ css = apply_filters ( 'kirki_styles_array' , $ css ) ; // Process the array of CSS properties and produce the final CSS. $ final_css = '' ; if ( ! is_array ( $ css ) || empty ( $ css ) ) { return '' ; } foreach ( $ css as $ media_query => $ styles ) { $ final_css .= ( 'global' !== $ media_query ) ? $ media_query . '{' : '' ; foreach ( $ styles as $ style => $ style_array ) { $ css_for_style = '' ; foreach ( $ style_array as $ property => $ value ) { if ( is_string ( $ value ) && '' !== $ value ) { $ css_for_style .= $ property . ':' . $ value . ';' ; } elseif ( is_array ( $ value ) ) { foreach ( $ value as $ subvalue ) { if ( is_string ( $ subvalue ) && '' !== $ subvalue ) { $ css_for_style .= $ property . ':' . $ subvalue . ';' ; } } } $ value = ( is_string ( $ value ) ) ? $ value : '' ; } if ( '' !== $ css_for_style ) { $ final_css .= $ style . '{' . $ css_for_style . '}' ; } } $ final_css .= ( 'global' !== $ media_query ) ? '}' : '' ; } return $ final_css ; }
Gets the array of generated styles and creates the minimized, inline CSS.

@static
@access public
@param array $css The CSS definitions array.
@return string    The generated CSS.
Gets the array of generated styles and creates the minimized inline CSS .