#64974 closed enhancement (fixed)
Block Supports: Add background gradient support that can combine with background images
| Reported by: | aaronrobertshaw | Owned by: | ramonopoly |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Editor | Version: | |
| Severity: | normal | Keywords: | gutenberg-merge has-patch has-unit-tests |
| Cc: | Focuses: |
Description
This ticket tracks the backport of PHP files for the following Gutenberg update:
https://github.com/WordPress/gutenberg/pull/75859
Adds background.gradient as a new block support, enabling blocks to have a gradient picker in the Background panel. This is separate from the existing color.gradient in the Color panel and allows blocks to combine a background gradient with a background image via comma-separated background-image CSS values.
The ability to move away from the shorthand background CSS property for block supports is also required to unblock further design tooling improvements such as text gradients.
Change History (13)
This ticket was mentioned in PR #11384 on WordPress/wordpress-develop by @aaronrobertshaw.
8 months ago
#1
- Keywords has-patch has-unit-tests added
@ramonopoly commented on PR #11384:
5 months ago
#2
Sorry I've kept this waiting for so long. Just rediscovered after working on https://github.com/WordPress/wordpress-develop/pull/12361
I can give it a test tomorrow - is there anything we're waiting on to get this?
@aaronrobertshaw commented on PR #11384:
5 months ago
#3
I believe everything should be good to go with this but as it has sat for a while, I'll need to give it a rebase first
@aaronrobertshaw commented on PR #11384:
5 months ago
#4
Actually, turns out I missed updating the core function to allow combined gradients and backgrounds properly via kses.
I've updated that now but the original Gutenberg PR only allowed modern color functions within gradients when combined with a background. I've tweaked that here so that it is consistent and they are supported for standalone gradients as well.
This will need backporting to Gutenberg so I'll spin up a PR doing that this evening or tomorrow.
@aaronrobertshaw commented on PR #11384:
5 months ago
#5
I've backported to Gutenberg the changes here allowing modern color definitions within standalone gradients in https://github.com/WordPress/gutenberg/pull/79791
@wildworks commented on PR #11384:
4 months ago
#6
I would appreciate it if you could proceed with this PR and commit it in time for the 7.1 Beta1 release on July 15.
@ramonopoly commented on PR #11384:
4 months ago
#7
@aaronrobertshaw do you need help landing this one?
@ramonopoly commented on PR #11384:
4 months ago
#8
I rebased this and retested. I think it's good to go.
@ramonopoly commented on PR #11384:
4 months ago
#9
I'll go ahead and commit this today
@ramonopoly commented on PR #11384:
4 months ago
#11
Comitted in r62718 / 6b190c64b2985841020e653da66cf8c1246909d6
@aaronrobertshaw commented on PR #11384:
4 months ago
#12
Thank you very much for picking this up and getting it committed @ramonjd 🙇
@ramonopoly commented on PR #11384:
4 months ago
#13
No worries. It's a long time coming, thanks for working on it and fixing it
Trac ticket: https://core.trac.wordpress.org/ticket/64974
styles.blocks.core/group.background.gradientproperty (e.g.,"gradient": "linear-gradient(135deg, #000 0%, #fff 100%)"). Verify the gradient renders correctly on the frontend.backgroundImageon the same Group block and confirm both values combine into a singlebackground-imageCSS declaration.style.color.gradientsupport continues to work on blocks that don't opt intobackground.gradient.style.color.gradientandstyle.background.gradient— confirmbackground.gradienttakes precedence and thecolor.gradientshorthand is suppressed.