Make WordPress Core

Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#60175 closed enhancement (fixed)

Add background size and repeat to the background image block support

Reported by: andrewserong's profile andrewserong Owned by: isabel_brison's profile isabel_brison
Milestone: 6.5 Priority: normal
Severity: normal Version: 6.5
Component: Editor Keywords: gutenberg-merge has-patch has-unit-tests
Focuses: Cc:

Description

Following on from #59357, in the Gutenberg plugin, features for background size and background repeat have been added to the editor's design tools for the background image block support.

It would be good to backport these features for the WP 6.5 release. While the features are spread across JS and PHP code, it should be safe to land the PHP changes in advance of the JS packages update for core.

The original features landed in the following Gutenberg PR: https://github.com/WordPress/gutenberg/pull/57005

Change History (5)

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


14 months ago
#1

  • Keywords has-patch has-unit-tests added

Add support for background size and background repeat to the background image block support, as used by the Group block.

This PR backports the PHP parts of the following Gutenberg PRs: https://github.com/WordPress/gutenberg/pull/57005 and https://github.com/WordPress/gutenberg/pull/57474

This PR only backports the PHP parts of the feature, however it can safely land prior to the JS packages updates for WP 6.5 as users will not be able to manually use these features in the editor until the JS packages are updated.

### Testing instructions

In a post or page of a site running TT4 theme, add the following markup in the code editor view. It contains a Group block with a background image set to a size of contain and a repeat of no-repeat:

A group block with a background image

The view in the editor will not reflect the background size and repeat rules yet, however with this PR, the site frontend's view should reflect that the image is contained within the area of the Group, is centered by default, and is set to not repeat:

https://i0.wp.com/github.com/WordPress/wordpress-develop/assets/14988353/8971a96f-3359-4f01-98bd-420f916a6583

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

@andrewserong commented on PR #5828:


13 months ago
#2

Small update to also include the changes from https://github.com/WordPress/gutenberg/pull/57495 in this backport.

#3 @isabel_brison
13 months ago

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

In 57254:

Editor: add size and repeat to background image support.

Adds background size and background repeat style processing to the background image block support and WP_Style_Engine definitions.

Props andrewserong, mukesh27.
Fixes #60175.

@isabel_brison commented on PR #5828:


13 months ago
#4

Committed in r57254.

@andrewserong commented on PR #5828:


13 months ago
#5

Thanks for reviewing and committing! 🙇

Note: See TracTickets for help on using tickets.