Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#61720 closed enhancement (fixed)

Background: add background attachment support to theme.json styles

Reported by: ramonopoly's profile ramonopoly Owned by: ramonopoly's profile ramonopoly
Milestone: 6.7 Priority: normal
Severity: normal Version: 6.7
Component: Themes Keywords: has-patch has-unit-tests gutenberg-merge
Focuses: Cc:

Description

A ticket to track the syncing of the PHP files for following Gutenberg PR:

It introduces the ability to specify a value for background.backgroundAttachment in theme.json styles, which sets a CSS value for the background-attachment property.

Change History (12)

This ticket was mentioned in PR #6991 on WordPress/wordpress-develop by @ramonopoly.


8 months ago
#1

Syncing changes from https://github.com/WordPress/gutenberg/pull/61382

[!NOTE]
This PR should be committed after https://github.com/WordPress/wordpress-develop/pull/6836 to ensure a clean rebase 😄

## Testing

This PR adds the backend functionality only, which means the editor UI isn't yet available.

To test, define a background image for the site in theme.json.

Here's an example using an image in src/wp-content/themes/twentytwentyfour/

{
        "$schema": "../../schemas/json/theme.json",
        "version": 3,
        "settings": {
                "appearanceTools": true
        },
        "styles": {
                "background": {
                                "backgroundImage": {
                                        "url": "file:./assets/images/art-gallery.webp"
                                },
                                "backgroundAttachment": "fixed"
                }
        }
}

Now check the site:

https://github.com/user-attachments/assets/6679d670-b306-45b4-858a-0b490bee5595

Trac ticket: https://core.trac.wordpress.org/ticket/61720

@ramonopoly commented on PR #6991:


8 months ago
#2

I've rebased on top of https://github.com/WordPress/wordpress-develop/pull/6836 and have added theme json block-level tests.

One thing to note is that https://github.com/WordPress/wordpress-develop/pull/6836 opens up block-level global styles, so I've updated the theme.json test snippet in the description.

🍺

@noisysocks commented on PR #6991:


8 months ago
#3

@ramonjd: Is this ready to commit?

@ramonopoly commented on PR #6991:


8 months ago
#4

Is this ready to commit?

Oh yes, please!!

@noisysocks commented on PR #6991:


8 months ago
#5

I intended that as a nudge for you... 😂 You win this round, I was unclear.

@ramonopoly commented on PR #6991:


8 months ago
#6

I intended that as a nudge for you... 😂 You win this round, I was unclear.

Haha. No worries. I mistakenly assumed there was some rule about committing your own patches.

#7 @ramonopoly
8 months ago

  • Owner set to ramonopoly
  • Resolution set to fixed
  • Status changed from new to closed

In 58834:

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

@noisysocks commented on PR #6991:


8 months ago
#9

Thanks!

#10 @kebbet
8 months ago

@ramonopoly Please milestone this ticket in the 6.7 milestone, since changesets where added during this cycle. Thanks!

#11 @ramonopoly
8 months ago

  • Milestone changed from Awaiting Review to 6.7

#12 @ramonopoly
8 months ago

Thanks for the nudge @kebbet

Done

Note: See TracTickets for help on using tickets.