Make WordPress Core


Ignore:
Timestamp:
02/01/2023 06:05:44 PM (4 years ago)
Author:
hellofromTonya
Message:

Themes: Add shadow presets support for theme.json.

Adds shadow presets support for theme.json within the WP_Theme_JSON by

  • Adding it to presets metadata and valid settings.
  • Defining the default shadow presets in Core's theme.json.

Includes PHPUnit tests.

References:

Follow-up to [54162], [52049], [50973].

Props madhudollu, mamaduka, oandregal, scruffian, hellofromTonya.
Fixes #57559.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json.php

    r55175 r55176  
    116116         * @since 6.0.0 Replaced `override` with `prevent_override` and updated the
    117117         *              `prevent_override` value for `color.duotone` to use `color.defaultDuotone`.
     118         * @since 6.2.0 Added 'shadow' presets.
    118119         * @var array
    119120         */
     
    177178                        'properties'        => array( 'padding', 'margin' ),
    178179                ),
     180                array(
     181                        'path'              => array( 'shadow', 'presets' ),
     182                        'prevent_override'  => array( 'shadow', 'defaultPresets' ),
     183                        'use_default_names' => false,
     184                        'value_key'         => 'shadow',
     185                        'css_vars'          => '--wp--preset--shadow--$slug',
     186                        'classes'           => array(),
     187                        'properties'        => array( 'box-shadow' ),
     188                ),
    179189        );
    180190
     
    295305         * @since 6.0.0 Added `color.defaultDuotone`.
    296306         * @since 6.1.0 Added `layout.definitions` and `useRootPaddingAwareAlignments`.
    297          * @since 6.2.0 Added `dimensions.minHeight`.
     307         * @since 6.2.0 Added `dimensions.minHeight`, 'shadow.presets', and 'shadow.defaultPresets'.
    298308         * @var array
    299309         */
     
    338348                        'padding'           => null,
    339349                        'units'             => null,
     350                ),
     351                'shadow'                        => array(
     352                        'presets'        => null,
     353                        'defaultPresets' => null,
    340354                ),
    341355                'typography'                    => array(
Note: See TracChangeset for help on using the changeset viewer.