Make WordPress Core


Ignore:
Timestamp:
09/19/2023 01:27:43 AM (3 years ago)
Author:
isabel_brison
Message:

Editor: add background image support.

Adds a new background block support with the ability to set a background image on blocks that opt into it.

Props andrewserong, mukesh27.
Fixes #59357.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/style-engine/styleEngine.php

    r56574 r56614  
    510510                                ),
    511511                        ),
     512
     513                        'inline_background_image_url_with_background_size' => array(
     514                                'block_styles'    => array(
     515                                        'background' => array(
     516                                                'backgroundImage' => array(
     517                                                        'url' => 'https://example.com/image.jpg',
     518                                                ),
     519                                                'backgroundSize'  => 'cover',
     520                                        ),
     521                                ),
     522                                'options'         => array(),
     523                                'expected_output' => array(
     524                                        'css'          => "background-image:url('https://example.com/image.jpg');background-size:cover;",
     525                                        'declarations' => array(
     526                                                'background-image' => "url('https://example.com/image.jpg')",
     527                                                'background-size'  => 'cover',
     528                                        ),
     529                                ),
     530                        ),
    512531                );
    513532        }
Note: See TracChangeset for help on using the changeset viewer.