Make WordPress Core


Ignore:
Timestamp:
07/31/2024 02:39:46 AM (2 years ago)
Author:
ramonopoly
Message:

Background: add background attachment support to theme.json styles

Introduces the ability to specify a value for background.backgroundAttachment in theme.json styles.

The theme.json value determines the CSS value for the background-attachment property.

This feature was introduced into the Gutenberg plugin in version 18.9.

Props andrewserong, mukesh27, noisysocks, ramonopoly.

Fixes #61720

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/style-engine/class-wp-style-engine.php

    r58311 r58834  
    5151        const BLOCK_STYLE_DEFINITIONS_METADATA = array(
    5252                'background' => array(
    53                         'backgroundImage'    => array(
     53                        'backgroundImage'      => array(
    5454                                'property_keys' => array(
    5555                                        'default' => 'background-image',
    … …  
    5858                                'path'          => array( 'background', 'backgroundImage' ),
    5959                        ),
    60                         'backgroundPosition' => array(
     60                        'backgroundPosition'   => array(
    6161                                'property_keys' => array(
    6262                                        'default' => 'background-position',
    … …  
    6464                                'path'          => array( 'background', 'backgroundPosition' ),
    6565                        ),
    66                         'backgroundRepeat'   => array(
     66                        'backgroundRepeat'     => array(
    6767                                'property_keys' => array(
    6868                                        'default' => 'background-repeat',
    … …  
    7070                                'path'          => array( 'background', 'backgroundRepeat' ),
    7171                        ),
    72                         'backgroundSize'     => array(
     72                        'backgroundSize'       => array(
    7373                                'property_keys' => array(
    7474                                        'default' => 'background-size',
    7575                                ),
    7676                                'path'          => array( 'background', 'backgroundSize' ),
     77                        ),
     78                        'backgroundAttachment' => array(
     79                                'property_keys' => array(
     80                                        'default' => 'background-attachment',
     81                                ),
     82                                'path'          => array( 'background', 'backgroundAttachment' ),
    7783                        ),
    7884                ),
Note: See TracChangeset for help on using the changeset viewer.