Background image block support: optimize image output #59113
Labels
[Feature] Design Tools
Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
[Type] Performance
Related to performance efforts
Part of #54336
As raised in #54336 (comment) and #54336 (comment) it would be good to come up with a way to optimise the image output for the background image block support which is currently used by the Group block.
Ideas discussed thus far
img
element within the Group block would be preferable as it allows bothsrcset
andloading="lazy"
so that images are lazy loaded, and only an image of an appropriate size.img
element however, can't implement all features supported bybackground-image
, so for example repeating backgrounds would not be able to use theimg
element approach.img
element and sometimes doesn't, this might make it hard for the support to work well with different themes and blocks that might opt in.img
element, how would this work with a background image support that is enabled in global styles? For example, if all Group or Post Content blocks are set to have a particular background image and we then go to update an individual block to use a different background image, how will these play together?image-set()
was discussed, however it doesn't work with width descriptors so isn't really a viable alternative to theimg
element'ssrcset
, and it doesn't allow lazy loading.style
tag, and still wouldn't support lazy loading. However we can output things to a style tag via the style engine, so it might be a possibility.Some requirements
Similar and related issues
Other ideas
This issue is a good place for dropping ideas, thoughts, questions, concerns for how we might go about implementing image optimisation for the background image block support.
The text was updated successfully, but these errors were encountered: