← All changes
|
build/scripts/style-engine/class-wp-style-engine-gutenberg.php
+26
-7
23.2.2
→
trunk
View file →
| @@ -236,8 +236,14 @@ | ||
| 236 | 236 | 'css_vars' => array( |
| 237 | 237 | 'dimension' => '--wp--preset--dimension--$slug', |
| 238 | 238 | ), |
| 239 | 239 | ), |
| 240 | + 'objectFit' => array( | |
| 241 | + 'property_keys' => array( | |
| 242 | + 'default' => 'object-fit', | |
| 243 | + ), | |
| 244 | + 'path' => array( 'dimensions', 'objectFit' ), | |
| 245 | + ), | |
| 240 | 246 | 'width' => array( |
| 241 | 247 | 'property_keys' => array( |
| 242 | 248 | 'default' => 'width', |
| 243 | 249 | ), |
| @@ -329,8 +335,20 @@ | ||
| 329 | 335 | 'default' => 'text-indent', |
| 330 | 336 | ), |
| 331 | 337 | 'path' => array( 'typography', 'textIndent' ), |
| 332 | 338 | ), |
| 339 | + 'textShadow' => array( | |
| 340 | + 'property_keys' => array( | |
| 341 | + 'default' => 'text-shadow', | |
| 342 | + ), | |
| 343 | + 'css_vars' => array( | |
| 344 | + 'text-shadow' => '--wp--preset--text-shadow--$slug', | |
| 345 | + ), | |
| 346 | + 'path' => array( 'typography', 'textShadow' ), | |
| 347 | + 'classnames' => array( | |
| 348 | + 'has-$slug-text-shadow' => 'text-shadow', | |
| 349 | + ), | |
| 350 | + ), | |
| 333 | 351 | 'textTransform' => array( |
| 334 | 352 | 'property_keys' => array( |
| 335 | 353 | 'default' => 'text-transform', |
| 336 | 354 | ), |
| @@ -369,10 +387,10 @@ | ||
| 369 | 387 | |
| 370 | 388 | /** |
| 371 | 389 | * Util: Generates a CSS var string, e.g., var(--wp--preset--color--background) from a preset string such as `var:preset|space|50`. |
| 372 | 390 | * |
| 373 | - * @param string $style_value A single CSS preset value. | |
| 374 | - * @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. | |
| 375 | 393 | * |
| 376 | 394 | * @return string The css var, or an empty string if no match for slug found. |
| 377 | 395 | */ |
| 378 | 396 | protected static function get_css_var_value( $style_value, $css_vars ) { |
| @@ -391,9 +409,9 @@ | ||
| 391 | 409 | |
| 392 | 410 | /** |
| 393 | 411 | * Util: Checks whether an incoming block style value is valid. |
| 394 | 412 | * |
| 395 | - * @param string? $style_value A single css preset value. | |
| 413 | + * @param string? $style_value A single css preset value. | |
| 396 | 414 | * |
| 397 | 415 | * @return bool |
| 398 | 416 | */ |
| 399 | 417 | protected static function is_valid_style_value( $style_value ) { |
| @@ -402,12 +420,13 @@ | ||
| 402 | 420 | |
| 403 | 421 | /** |
| 404 | 422 | * Stores a CSS rule using the provided CSS selector and CSS declarations. |
| 405 | 423 | * |
| 406 | - * @param string $store_name A valid store key. | |
| 407 | - * @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. | |
| 408 | - * @param string[] $css_declarations An associative array of CSS definitions, e.g., array( "$property" => "$value", "$property" => "$value" ). | |
| 409 | - * @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`. | |
| 410 | 429 | * |
| 411 | 430 | * @return void. |
| 412 | 431 | */ |
| 413 | 432 | public static function store_css_rule( $store_name, $css_selector, $css_declarations, $rules_group = '' ) { |