Returns a compiled stylesheet from stored CSS rules.
$css_rulesWP_Style_Engine_CSS_Rule[]required
$optionsarrayoptional
context string|null'block-supports' or 'global-styles'. Default 'block-supports'.optimize boolprettify boolSCRIPT_DEBUG constant is defined.Default:array()
public static function compile_stylesheet_from_css_rules( $css_rules, $options = array() ) {
$processor = new WP_Style_Engine_Processor();
$processor->add_rules( $css_rules );
return $processor->get_css( $options );
}
| Version | Description |
|---|---|
| 6.1.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_style_engine/compile_stylesheet_from_css_rules