Editor: Add `box-shadow` support for blocks through `theme.json` files.

This makes it possible to add `box-shadow` to specific blocks (such as buttons or groups), allowing this to be configured in block themes without custom CSS.

Props andrewserong, cbravobernal, madhudollu, scruffian, onemaggie.
See #56467.
Built from https://develop.svn.wordpress.org/trunk@54253


git-svn-id: http://core.svn.wordpress.org/trunk@53812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2022-09-20 13:50:09 +00:00
parent fd7c5261ec
commit 62f77df49a
2 changed files with 8 additions and 4 deletions

View File

@ -334,6 +334,7 @@ class WP_Theme_JSON {
* added new properties for `border`, `filter`, `spacing`,
* and `typography`.
* @since 6.1.0 Added new side properties for `border`,
* added new property `shadow`,
* updated `blockGap` to be allowed at any level.
* @var array
*/
@ -356,6 +357,7 @@ class WP_Theme_JSON {
'filter' => array(
'duotone' => null,
),
'shadow' => null,
'spacing' => array(
'margin' => null,
'padding' => null,
@ -584,9 +586,11 @@ class WP_Theme_JSON {
*/
$styles_non_top_level = static::VALID_STYLES;
foreach ( array_keys( $styles_non_top_level ) as $section ) {
foreach ( array_keys( $styles_non_top_level[ $section ] ) as $prop ) {
if ( 'top' === $styles_non_top_level[ $section ][ $prop ] ) {
unset( $styles_non_top_level[ $section ][ $prop ] );
if ( array_key_exists( $section, $styles_non_top_level ) && is_array( $styles_non_top_level[ $section ] ) ) {
foreach ( array_keys( $styles_non_top_level[ $section ] ) as $prop ) {
if ( 'top' === $styles_non_top_level[ $section ][ $prop ] ) {
unset( $styles_non_top_level[ $section ][ $prop ] );
}
}
}
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-54252';
$wp_version = '6.1-alpha-54253';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.