← All changes
|
build/scripts/style-engine/class-wp-style-engine-gutenberg.php
+14
-7
23.5.2
→
trunk
View file →
| @@ -339,9 +339,15 @@ | ||
| 339 | 339 | 'textShadow' => array( |
| 340 | 340 | 'property_keys' => array( |
| 341 | 341 | 'default' => 'text-shadow', |
| 342 | 342 | ), |
| 343 | + 'css_vars' => array( | |
| 344 | + 'text-shadow' => '--wp--preset--text-shadow--$slug', | |
| 345 | + ), | |
| 343 | 346 | 'path' => array( 'typography', 'textShadow' ), |
| 347 | + 'classnames' => array( | |
| 348 | + 'has-$slug-text-shadow' => 'text-shadow', | |
| 349 | + ), | |
| 344 | 350 | ), |
| 345 | 351 | 'textTransform' => array( |
| 346 | 352 | 'property_keys' => array( |
| 347 | 353 | 'default' => 'text-transform', |
| @@ -381,10 +387,10 @@ | ||
| 381 | 387 | |
| 382 | 388 | /** |
| 383 | 389 | * Util: Generates a CSS var string, e.g., var(--wp--preset--color--background) from a preset string such as `var:preset|space|50`. |
| 384 | 390 | * |
| 385 | - * @param string $style_value A single CSS preset value. | |
| 386 | - * @param string[] $css_vars An associate array of CSS var patterns used to generate the var string. | |
| 391 | + * @param string $style_value A single CSS preset value. | |
| 392 | + * @param string[] $css_vars An associate array of CSS var patterns used to generate the var string. | |
| 387 | 393 | * |
| 388 | 394 | * @return string The css var, or an empty string if no match for slug found. |
| 389 | 395 | */ |
| 390 | 396 | protected static function get_css_var_value( $style_value, $css_vars ) { |
| @@ -403,9 +409,9 @@ | ||
| 403 | 409 | |
| 404 | 410 | /** |
| 405 | 411 | * Util: Checks whether an incoming block style value is valid. |
| 406 | 412 | * |
| 407 | - * @param string? $style_value A single css preset value. | |
| 413 | + * @param string? $style_value A single css preset value. | |
| 408 | 414 | * |
| 409 | 415 | * @return bool |
| 410 | 416 | */ |
| 411 | 417 | protected static function is_valid_style_value( $style_value ) { |
| @@ -414,12 +420,13 @@ | ||
| 414 | 420 | |
| 415 | 421 | /** |
| 416 | 422 | * Stores a CSS rule using the provided CSS selector and CSS declarations. |
| 417 | 423 | * |
| 418 | - * @param string $store_name A valid store key. | |
| 419 | - * @param string $css_selector When a selector is passed, the function will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. | |
| 420 | - * @param string[] $css_declarations An associative array of CSS definitions, e.g., array( "$property" => "$value", "$property" => "$value" ). | |
| 421 | - * @param string $rules_group Optional. A parent CSS selector in the case of nested CSS, or a CSS nested @rule, such as `@media (min-width: 80rem)` or `@layer module`. | |
| 424 | + * @param string $store_name A valid store key. | |
| 425 | + * @param string $css_selector When a selector is passed, the function will return a full CSS rule `$selector { ...rules }`, otherwise a concatenated string of properties and values. | |
| 426 | + * @param string[]|WP_Style_Engine_CSS_Declarations_Gutenberg $css_declarations An associative array of CSS definitions, e.g., array( "$property" => "$value", "$property" => "$value" ), | |
| 427 | + * or a WP_Style_Engine_CSS_Declarations_Gutenberg object. | |
| 428 | + * @param string $rules_group Optional. A parent CSS selector in the case of nested CSS, or a CSS nested @rule, such as `@media (min-width: 80rem)` or `@layer module`. | |
| 422 | 429 | * |
| 423 | 430 | * @return void. |
| 424 | 431 | */ |
| 425 | 432 | public static function store_css_rule( $store_name, $css_selector, $css_declarations, $rules_group = '' ) { |