Make WordPress Core

Changeset 56046


Ignore:
Timestamp:
06/26/2023 11:42:16 PM (11 months ago)
Author:
isabel_brison
Message:

Editor: add box shadow support to blocks.

Adds the ability for blocks to declare support for CSS box-shadow and processing of necessary styles.

Props madhudollu, sabernhardt, ramonopoly, spacedmonkey, mukesh27.
Fixes #58590.

Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/kses.php

    r56020 r56046  
    22812281 *              and `z-index` CSS properties.
    22822282 * @since 6.3.0 Extended support for `filter` to accept a URL and added support for repeat().
     2283 *              Added support for `box-shadow`.
    22832284 *
    22842285 * @param string $css        A string of CSS rules.
     
    24482449            'left',
    24492450            'z-index',
     2451            'box-shadow',
    24502452            'aspect-ratio',
    24512453
  • trunk/src/wp-includes/style-engine/class-wp-style-engine.php

    r55985 r56046  
    149149            ),
    150150        ),
     151        'shadow'     => array(
     152            'shadow' => array(
     153                'property_keys' => array(
     154                    'default' => 'box-shadow',
     155                ),
     156                'path'          => array( 'shadow' ),
     157                'css_vars'      => array(
     158                    'shadow' => '--wp--preset--shadow--$slug',
     159                ),
     160            ),
     161        ),
    151162        'dimensions' => array(
    152163            'minHeight' => array(
  • trunk/src/wp-settings.php

    r56007 r56046  
    332332require ABSPATH . WPINC . '/block-supports/dimensions.php';
    333333require ABSPATH . WPINC . '/block-supports/duotone.php';
     334require ABSPATH . WPINC . '/block-supports/shadow.php';
    334335require ABSPATH . WPINC . '/block-supports/elements.php';
    335336require ABSPATH . WPINC . '/block-supports/generated-classname.php';
  • trunk/tests/phpunit/tests/style-engine/styleEngine.php

    r55985 r56046  
    2727     * @ticket 56467
    2828     * @ticket 58549
     29     * @ticket 58590
    2930     *
    3031     * @covers ::wp_style_engine_get_styles
     
    183184            ),
    184185
     186            'inline_valid_shadow_style'                    => array(
     187                'block_styles'    => array(
     188                    'shadow' => 'inset 5em 1em gold',
     189                ),
     190                'options'         => null,
     191                'expected_output' => array(
     192                    'css'          => 'box-shadow:inset 5em 1em gold;',
     193                    'declarations' => array(
     194                        'box-shadow' => 'inset 5em 1em gold',
     195                    ),
     196                ),
     197            ),
     198
    185199            'inline_valid_typography_style'                => array(
    186200                'block_styles'    => array(
Note: See TracChangeset for help on using the changeset viewer.