Make WordPress Core


Ignore:
Timestamp:
08/26/2024 05:38:05 AM (17 months ago)
Author:
ramonopoly
Message:

Background images: resolve theme.json dynamic ref values and ensure appropriate style default values

The commit syncs the following changes from Gutenberg:

  • Background images: add support for theme.json ref value resolution gutenberg#64128
  • Background images: ensure appropriate default values gutenberg#64192
  • Background image: ensure consistency with defaults and fix reset/remove functionality gutenberg#64328

These changes brings consistency to the default background image styles WordPress applies to user uploaded images, and adds support for ref resolution to "background" style properties.

Props andrewserong, aaronrobertshaw.

Fixes #61858

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/background.php

    r58834 r58936  
    7676        // If the background size is set to `contain` and no position is set, set the position to `center`.
    7777        if ( 'contain' === $background_styles['backgroundSize'] && ! $background_styles['backgroundPosition'] ) {
    78             $background_styles['backgroundPosition'] = 'center';
     78            $background_styles['backgroundPosition'] = '50% 50%';
    7979        }
    8080    }
Note: See TracChangeset for help on using the changeset viewer.