-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Background Image block support follow-up tasks #54336
Comments
Image embeds are vital for prototyping within the block editor (before comitting them to the media library). |
Pulling from the FSE Outreach Program's Final Touches call for testing, I wondered if the focal point option would eventually be added in as well:
Happy to open a separate issue if that's easier! |
Oh, yes! It'd be good to have that as an option, too. I've added it to the list in this tracking issue — no need to create a separate issue for it just yet, I think this is a good place to gather together the ideas for now.
Color overlay is possibly a little out of scope for the Group block, as it's well handled by the Cover block and would require additional markup to achieve. The main differences between what we can do for the Group vs Cover blocks at the moment is whether the additional styling rules can be applied to a simple outer wrapper (Group block) vs requiring an additional inner wrapper (Cover block). |
I'm +1 a few of the recommendations here. Here's the list I gathered based on stuff we offer for the Cover Block, all of them already shared:
@andrewserong I believe you're also aware of Automattic/wp-calypso#82284 but I wanted to move it here just to confirm if the lack of padding on the group block is currently expected or if we should indeed offer a default padding if there is a background image/color. Thank you! |
Thanks for adding that feedback here @eduardozulian!
Lack of padding on the Group block is expected. The Cover block is a more opinionated block when it comes to adding a background image, and so padding is formally a part of that block's background image implementation. The Group blocks are more general purpose blocks so it's up to the user (or pattern) to add padding when required. There are currently no plans to add padding by default when a user selects a background image. |
I see that the generated inline style escapes the quotation marks within
I don’t see this being a standard in core. If it isn’t, could this be changed to using unescaped quotes? |
@webzunft I believe the escaping occurs due to how the attribute is output in server rendering as the HTML Tag Processor internally calls |
@andrewserong thanks for your reply. The browser (Chrome) correctly renders the output, so no problem there. I have a plugin that changes HTML in the frontend to inject some information (image captions), which broke with these escaped quotes, but nothing I can’t adjust on my end. |
I'm currently looking at image optimizations for various blocks in the editor, and wanted to raise the issue here of needing to allow the browser to optimize loading the most appropriate image for the user. For blocks that render images as Related: |
Not sure if you meant opacity here as well. I'm genuinely curious what the use case is for the group block with a background image but no way to control the overlay? Groups have content, usually text,and most background images will make text illegible without some way of reducing the brightness. I've created hundreds of patterns, and I can't think of a single use case where I didn't use opacity when using a background image on the cover block. Unfortunately, background images and the ability to control opacity and background color are inextricably tied together. If we're adding it to groups, for consistency and usability, it has to come with these controls to make it practically usable. It will be an ongoing battle with users for sure! |
Great question. In my experience there are heaps! A good example of use cases for background images that don't require overlay colors are ones that already include transparency within them, or images that folks have selected for their particular content (i.e. I know I'm going to write something with white text, so I'll pick a nice subdued dark image as my background). For examples of some good transparent background images, I've been playing with those at https://www.transparenttextures.com/ and https://www.toptal.com/designers/subtlepatterns/. Many of those sorts of background images require being able to set the image to repeat, which is being worked on over in #57005. In terms of the user being able to adjust the opacity or overlay of the background image itself from within the editor, I think that's a great idea, it's just not a very simple task to implement within block supports or to enable for the Group block, so for now I think the other block support features are more pressing to implement, as the Cover block can already handle the overlay case. I'm just one contributor chipping away at this, but in my opinion, I'd go for us building out the remaining features of the background image support that don't require altering markup (as overlay would require injecting an additional element), and to revisit the idea a little further down the track. It would be nice to support opacity/overlay for it eventually, for sure. I've added it as an item to the issue's description 👍 |
Update: the background size / repeat controls (#57005) are now available on 2023-12-22.12.12.49.mp4There were some good ideas for UI follow-ups (e.g. #57005 (comment)) that I'm hoping to look into in the new year, along with background position controls. |
Apologies for the brevity. |
Hi folks, |
@colorful-tones this issue is under active work, but the work has been updated in the issue description rather than in separate comments here (CC: @ramonjd). In the issue description, there are two tasks yet to be finished for 6.6 (and one of them is a polishing issue, so it might be able to be worked on during the beta period). Additionally, there are currently two backport PRs underway for backporting site-wide background images with support for theme relative URLs:
Can we re-add this issue to the board, or would it be more helpful adding the specific backports that need to make it in? There have been quite a few PRs landing for 6.6, but they largely all fall under the umbrella of enabling site wide background images. Hope that helps! |
Thanks @andrewserong and @colorful-tones!
If you look at the description edit history, it's seen quite a lot action 😄 I'll tentatively add the two backport Thanks! |
Related to #16479, following on from #14744.
Now that the background image block support has been introduced in #53934, this issue captures some ideas for follow-up tasks and features.
Prioritized tasks for WP 6.8 and beyond
background-image
#60739background-image
instead ofbackground
#32787 - Get the block support to work with gradient backgrounds in a logical way. See related comment: Global styles: add background image to top-level theme.json styles #59354 (comment)background-image
#60739 (comment)Prioritized tasks for WP 6.7
Completed for WP 6.6
min-height
values match when a background is selected. Global styles: force root min-height of 100% for backgrounds #59809Completed for WP 6.5
contain
, fixed size and repeat controls: Background image: Add backgroundSize and repeat features #57005has-background
CSS class is missing #56261Unprioritized tasks
url(...)
string values. See Background images: add support for theme.json ref value resolution #64128 (comment)stylesheet_uri
andtemplate_uri
field to themes endpoint (Trac ticket, Core PR)img
element)Background position improvements
The text was updated successfully, but these errors were encountered: