From 82164ab31ee2fdc3cafa121728cd3387452a09d5 Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 20 Sep 2023 16:44:27 +1000 Subject: [PATCH 1/2] The doc comments for css_var were topsy turvy. The css_var property used to be this way, e.g., '--wp--preset--color--$slug' => 'color' , but then we swapped it around. --- .../style-engine/class-wp-style-engine.php | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/src/wp-includes/style-engine/class-wp-style-engine.php b/src/wp-includes/style-engine/class-wp-style-engine.php index 6bb03a707011a..323a74e2e127a 100644 --- a/src/wp-includes/style-engine/class-wp-style-engine.php +++ b/src/wp-includes/style-engine/class-wp-style-engine.php @@ -26,26 +26,19 @@ #[AllowDynamicProperties] final class WP_Style_Engine { /** - * Style definitions that contain the instructions to - * parse/output valid Gutenberg styles from a block's attributes. - * - * For every style definition, the following properties are valid: - * - * - classnames => (array) An array of classnames to be returned for block styles. - * The key is a classname or pattern. - * A value of `true` means the classname should be applied always. - * Otherwise, a valid CSS property (string) to match the incoming value, - * e.g. "color" to match var:preset|color|somePresetSlug. - * - css_vars => (array) An array of key value pairs used to generate CSS var values. - * The key is a CSS var pattern, whose `$slug` fragment will be replaced with a preset slug. - * The value should be a valid CSS property (string) to match the incoming value, - * e.g. "color" to match var:preset|color|somePresetSlug. - * - property_keys => (array) An array of keys whose values represent a valid CSS property, - * e.g. "margin" or "border". - * - path => (array) A path that accesses the corresponding style value in the block style object. - * - value_func => (string) The name of a function to generate a CSS definition array - * for a particular style object. The output of this function should be - * `array( "$property" => "$value", ... )`. + * Style definitions that contain the instructions to parse/output valid Gutenberg styles from a block's attributes. + * For every style definition, the follow properties are valid: + * - classnames => (array) an array of classnames to be returned for block styles. The key is a classname or pattern. + * A value of `true` means the classname should be applied always. Otherwise, a valid CSS property (string) + * to match the incoming value, e.g., "color" to match var:preset|color|somePresetSlug. + * - css_vars => (array) an array of key value pairs used to generate CSS var values. + * The key should be the CSS property name that matches the second element of the preset string value, + * i.e., "color" in var:preset|color|somePresetSlug. The value is a CSS var pattern (e.g. `--wp--preset--color--$slug`), + * whose `$slug` fragment will be replaced with the preset slug, which is the third element of the preset string value, + * i.e., `somePresetSlug` in var:preset|color|somePresetSlug. + * - property_keys => (array) array of keys whose values represent a valid CSS property, e.g., "margin" or "border". + * - path => (array) a path that accesses the corresponding style value in the block style object. + * - value_func => (string) the name of a function to generate a CSS definition array for a particular style object. The output of this function should be `array( "$property" => "$value", ... )`. * * @since 6.1.0 * @var array From 46acddfe6b2187ca9e76e36f4a31a03a67e0a66a Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 20 Sep 2023 16:50:08 +1000 Subject: [PATCH 2/2] Spaces between comment lines --- src/wp-includes/style-engine/class-wp-style-engine.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-includes/style-engine/class-wp-style-engine.php b/src/wp-includes/style-engine/class-wp-style-engine.php index 323a74e2e127a..6e7a8f56af925 100644 --- a/src/wp-includes/style-engine/class-wp-style-engine.php +++ b/src/wp-includes/style-engine/class-wp-style-engine.php @@ -27,7 +27,9 @@ final class WP_Style_Engine { /** * Style definitions that contain the instructions to parse/output valid Gutenberg styles from a block's attributes. + * * For every style definition, the follow properties are valid: + * * - classnames => (array) an array of classnames to be returned for block styles. The key is a classname or pattern. * A value of `true` means the classname should be applied always. Otherwise, a valid CSS property (string) * to match the incoming value, e.g., "color" to match var:preset|color|somePresetSlug.