WP_Theme_JSON::resolve_variables( WP_Theme_JSON $theme_json ): WP_Theme_JSON

In this article

Resolves the values of CSS variables in the given styles.

Parameters

$theme_jsonWP_Theme_JSONrequired
The theme json resolver.

Return

WP_Theme_JSON The $theme_json with resolved variables.

Source

protected function get_feature_declarations_for_node( $metadata, &$node ) {
	$declarations = array();

	if ( ! isset( $metadata['selectors'] ) ) {
		return $declarations;
	}

	$settings = isset( $this->theme_json['settings'] )
		? $this->theme_json['settings']
		: array();

	foreach ( $metadata['selectors'] as $feature => $feature_selectors ) {
		/*
		 * Skip if this is the block's root selector or the block doesn't
		 * have any styles for the feature.
		 */
		if ( 'root' === $feature || empty( $node[ $feature ] ) ) {
			continue;

Changelog

VersionDescription
6.3.0Introduced.

User Contributed Notes

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