WP_Theme_JSON::to_ruleset( string $selector, array $declarations ): string

In this article

Given a selector and a declaration list, creates the corresponding ruleset.

Parameters

$selectorstringrequired
CSS selector.
$declarationsarrayrequired
List of declarations.

Return

string The resulting CSS ruleset.

Source

	}

	$selector = $metadata['selector'];

	$node                    = _wp_array_get( $this->theme_json, $metadata['path'], array() );
	$declarations            = static::compute_preset_vars( $node, $origins );
	$theme_vars_declarations = static::compute_theme_vars( $node );
	foreach ( $theme_vars_declarations as $theme_vars_declaration ) {
		$declarations[] = $theme_vars_declaration;
	}

	$stylesheet .= static::to_ruleset( $selector, $declarations );
}

Changelog

VersionDescription
5.8.0Introduced.

User Contributed Notes

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