From 627d8a60cded8ce44050ebeb20dfeb3d3c28d4d5 Mon Sep 17 00:00:00 2001 From: ramon Date: Mon, 19 Dec 2022 16:30:03 +1100 Subject: [PATCH] Remove readme doc for now since it won't be in core for a while. --- packages/style-engine/README.md | 38 --------------------------------- 1 file changed, 38 deletions(-) diff --git a/packages/style-engine/README.md b/packages/style-engine/README.md index d1db352be7a4c2..999fab2aa835e9 100644 --- a/packages/style-engine/README.md +++ b/packages/style-engine/README.md @@ -36,7 +36,6 @@ _Parameters_ - _context_ `string` An identifier describing the origin of the style object, e.g., 'block-supports' or 'global-styles'. Default is 'block-supports'. When both `context` and `selector` are set, the Style Engine will store the CSS rules using the `context` as a key. - _convert_vars_to_classnames_ `boolean` Whether to skip converting CSS var:? values to var( --wp--preset--\* ) values. Default is `false`. - _selector_ `string` When a selector is passed, `generate()` will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. - - _metadata_ `array` An associate array in the format of WP_Style_Engine::BLOCK_STYLE_DEFINITIONS_METADATA that extends the latter. _Returns_ `array|null` @@ -88,43 +87,6 @@ array( */ ``` -The default block style support definitions can be extended by passing metadata in the options. - -```php -$block_attributes = array( - 'style' => array( - 'layout' => array( 'float' => 'left' ), - ), -); - -$styles = wp_style_engine_get_styles( - $block_attributes['style'], - array( - 'selector' => '.a-selector', - 'metadata' => array( - 'layout' => array( - 'float' => array( - 'property_keys' => array( - 'default' => 'float', - ), - 'path' => array( 'layout', 'float' ), - ), - ), - ) - ) -); -print_r( $styles ); - -/* -array( - 'css' => '.a-selector{float:left}' - 'declarations' => array( 'float' => 'left' ) -) -*/ -``` - -Note: CSS properties must be supported by [safecss_filter_attr](https://developer.wordpress.org/reference/functions/safecss_filter_attr/), otherwise you can allow non-supported CSS using the filter [safecss_filter_attr_allow_css](https://developer.wordpress.org/reference/hooks/safecss_filter_attr_allow_css/). - ### wp_style_engine_get_stylesheet_from_css_rules() Use this function to compile and return a stylesheet for any CSS rules. The Style Engine will automatically merge declarations and combine selectors.