WordPress at Your Fingertips
function is not described

WP_Theme_JSON::get_stylesheet() public WP 5.8.0

Returns the stylesheet that results of processing the theme.json structure this object represents.

{} It's a method of the class: WP_Theme_JSON{}

No Hooks.

Return

String. Stylesheet.

Usage

$WP_Theme_JSON = new WP_Theme_JSON();
$WP_Theme_JSON->get_stylesheet( $type );
$type(string)
Type of stylesheet we want. Accepts 'all', 'block_styles', and 'css_variables'.
Default: 'all'

Changelog

Since 5.8.0 Introduced.

Code of WP_Theme_JSON::get_stylesheet() WP 5.8.2

public function get_stylesheet( $type = 'all' ) {
	$blocks_metadata = self::get_blocks_metadata();
	$style_nodes     = self::get_style_nodes( $this->theme_json, $blocks_metadata );
	$setting_nodes   = self::get_setting_nodes( $this->theme_json, $blocks_metadata );

	switch ( $type ) {
		case 'block_styles':
			return $this->get_block_styles( $style_nodes, $setting_nodes );
		case 'css_variables':
			return $this->get_css_variables( $setting_nodes );
		default:
			return $this->get_css_variables( $setting_nodes ) . $this->get_block_styles( $style_nodes, $setting_nodes );
	}

}