[wp-trac] [WordPress Trac] #61858: Background images: resolve ref and ensure appropriate default values
WordPress Trac
noreply at wordpress.org
Mon Aug 12 01:26:41 UTC 2024
#61858: Background images: resolve ref and ensure appropriate default values
-------------------------+-------------------------------------------------
Reporter: ramonopoly | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.7
Component: Themes | Version:
Severity: normal | Keywords: has-patch has-unit-tests gutenberg-
Focuses: | merge
-------------------------+-------------------------------------------------
Background image theme.json styling for blocks is slated for 6.7. See
#61588
This ticket tracks the following enhancements to background image block
styles supports:
== Add support for "ref" values in theme.son
Theme.json values support "referencing" another value in theme.json using
the "ref" keyword.
These values are resolved by the WP_Theme_JSON class.
"background" style properties do not yet support this feature.
== Default values are not applied consistently
Blocks with user-applied background images, i.e., background images added
from a site's media library, receive certain default background size and
position styles.
These default styles increase the likelihood that an image sits well in a
block without the user doing anything else.
An enhancement here is to extend these defaults for uploaded images in
block global styles.
**Why set defaults only for uploaded images and not those defined in
theme.json?**
Setting defaults changes the way the background-image appears.
Images added by the user in the editor receive defaults to increase the
chances that they look "okay" in the editor immediately.
We should respect, as much as possible, the values in theme.json, that
includes values that are not set. The assumption is theme developers
explicitly add and omit values. If the editor were to add default to
theme.json styles, it would undermine that assumption.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61858>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list