Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the Cover block image controls available on the Background image Styles panel #66793

Open
henriqueiamarino opened this issue Nov 6, 2024 · 4 comments
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.

Comments

@henriqueiamarino
Copy link

I propose replicating the cover block's style controls (left) on the background image panel (right).

This update will bring consistency to our editor by enabling color, overlay opacity, and filters to be applied in more image instances.
Currently, such styles are available for cover block, featured image, and image block.

Image

@henriqueiamarino henriqueiamarino added the [Type] Enhancement A suggestion for improvement. label Nov 6, 2024
@jasmussen
Copy link
Contributor

Nice one. There's definitely a task here to unify our "background tools", for example if you set a gradient background, the same cover/contain/tile tools would be useful. @ramonjd is there already an issue for tracking some of this unification work? To be clear the unification likely has to go both ways, bringing some of the the Cover color controls into a "Background" panel, for example.

@ramonjd ramonjd added [Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Nov 20, 2024
@ramonjd
Copy link
Member

ramonjd commented Nov 20, 2024

Hi folks! 👋🏻

Thanks for the ping.

Just to be clear, what is the proposition here? Is it to add background color, opacity and filter support to background images?

the unification likely has to go both ways, bringing some of the the Cover color controls into a "Background" panel, for example.

Yeah, ideally, when background supports is fully mature it'd completely replace the cover block custom controls.

It's a bit of crystal ball gazing at the moment given the quagmire of cover block deprecations and special cases.

Furthermore, for background colors specifically, there's a long-standing issue related to the way WordPress has applied background gradient. The TL;DR is that gradients are applied using the background CSS property, which will overwrite other background-* properties. This bug needs to be rectified.

Here are some related PRs and issues:

There's a catch-all tracking issue for follow ups to background supports over here:

@jasmussen
Copy link
Contributor

I think those related PRs and tracking issue well capture the goal at hand, to unify background controls so they function across. For example, a gradient background can be resized, repeat, positinoed, just like a background can.

I suppose the unique aspect of this issue—and it may need to be renamed slightly to encourage some explorations—is that the Cover block overlay serves both as a background when you have no image set, and as a background image overlay when you do have one. Likely the solution is a UI not unlike this, which shows each background element as a layer that you can move around. The overlay would simply be a color fill on top of a background layer.

As noted, we're already working towards that across a few different issues. Do you know if the specific use case: background layers, is tracked anywhere already? If not, we could potentially re-work this one, and seek out a fresh design for it. LMK!

@ramonjd
Copy link
Member

ramonjd commented Nov 21, 2024

Do you know if the specific use case: background layers, is tracked anywhere already?

Apart from the link you cited, not really.

There's a related technical discussion over in #60739 (comment), where we riffed on how to represent layers in theme.json.

It's going to be a great feature as soon as there's a chunk of time to work on it and get the foundations in place!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants