Make WordPress Core


Ignore:
Timestamp:
07/31/2024 02:39:46 AM (3 months 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/class-wp-theme-json.php

    r58797 r58834  
    227227     * @since 6.5.0 Added `aspect-ratio` property.
    228228     * @since 6.6.0 Added `background-[image|position|repeat|size]` properties.
     229     * @since 6.7.0 Added `background-attachment` property.
    229230     *
    230231     * @var array
     
    238239        'background-repeat'                 => array( 'background', 'backgroundRepeat' ),
    239240        'background-size'                   => array( 'background', 'backgroundSize' ),
     241        'background-attachment'             => array( 'background', 'backgroundAttachment' ),
    240242        'border-radius'                     => array( 'border', 'radius' ),
    241243        'border-top-left-radius'            => array( 'border', 'radius', 'topLeft' ),
     
    521523    const VALID_STYLES = array(
    522524        'background' => array(
    523             'backgroundImage'    => null,
    524             'backgroundPosition' => null,
    525             'backgroundRepeat'   => null,
    526             'backgroundSize'     => null,
     525            'backgroundImage'      => null,
     526            'backgroundPosition'   => null,
     527            'backgroundRepeat'     => null,
     528            'backgroundSize'       => null,
     529            'backgroundAttachment' => null,
    527530        ),
    528531        'border'     => array(
Note: See TracChangeset for help on using the changeset viewer.