Group Block - add support for Background Images
The Group Block recently merged with support for background colors. As a next step, it would be good to add support for background images along with the focal picker.
Describe the solution you'd like
This would upgrade the Group Block with the following:
- Ability to choose a background image as the background
- Ability to pick the focal point for that background image
- Ability to set color overlay (as per
coverBlock) (thanks to @SchneiderSam )
Considerations
- Would this bring the Block too close to the current
coverBlock? Or should we encourage users to utilise acoverBlock within asectionto achieve this?
Great would be in this move also a color overlay as with the Cover Block.
Yeah, I'm not sure about this as this will just be a cover block in the end if we do this.
As an end user, I understand it this way:
Cover Block: a block to add text to a background image at the beginning of a post. Alternatively it can also be used in the middle of a post as call-to-action.
Section Block: can do anything. Columns, background color, background image, Section in Section, ect... Simply: The LEGO building block for a website.
It would be great to know which block should be used for what. For me the cover block is completely superfluous. The Block section should have all the functions currently available in the cover block.
A section block without the possibility to insert pictures just doesn't make sense. This is a must have!
A section block without the possibility to insert pictures just doesn't make sense. This is a must have!
Thanks for sharing your opinion, let's keep the discussion flowing but let's avoid "absolute" statements. "this doesn't make sense, this is a must have".
Ok. Sorry!
I would prefer if the cover block (and all blocks with InnerBlock) supported filtering the list of allowed inner blocks. The themes that want to add 3 columns inside a Cover Block could write the styles to support it.
Why not use the cover block if the aim is to have a background image ?
@truchot - the cover block doesn't support nested blocks.
Adding to @getdave's feature request: The ability to fix image position and add a background overlay.
My use case: I want to create a masthead with a header, subtitle and button. Mastheads like these are very common. See Bootstrap's Punny headline.
@truchot - the cover block doesn't support nested blocks.
Yes it does :)
- You can install Gutenberg as a plugin to get last features
- Or wait WordPress 5.2 that will be released very soon
o perfect @truchot! Didn't catch that in the release notes. It still doesn't support other blocks, like columns.
My question now: Why not get rid of the cover block and just add the same background settings to the group? We can add the extra spacing with a spacing block
Mockups:

(Please note that as this is an older mockup, many general UI elements are outdated.)
Some questions:
- We'd be reusing image settings from Cover.
- Instead of overlay color, I'm using opacity, so color and image can remain independent. Does this make sense?
- Should we use the new swap image flow for changing background images and include an image icon in the toolbar, instead of putting it in the sidebar?
- Is there any way to measure color contrast of text over an image?
Well, I still think that's a great thing. I hardly use the cover block at all. I'm a big fan of these groups and at the moment I'm still solving everything about the function: individual classes. If this is pushed further, it would be a nice thing for the end user! Please carry on!
This wouldn't be that difficult to achieve. Personally, I feel it is a worthy addition to the Group Block, but I know others have reservations.
Discussed during today's accessibility bug scrub, agreed on a couple recommendations:
- Important settings in the sidebar should be avoided: this is part of the long standing issue related to navigation from the content area to the sidebar and back. Noted in many other issues and PRs. All controls that are essential to producing content should be within the block itself. We, as a team, recommend to reconsider and place the most important ones within the block
- re: "Is there any way to measure color contrast of text over an image?". Not that we're aware of. This always require manual checking. An idea could be a short explanatory text to inform users to take care of the contrast.
All controls that are essential to producing content should be within the block itself. We, as a team, recommend to reconsider and place the most important ones within the block
Which setting are the a11y team thinking?
We haven't discussed specifically which settings. Personal opinion: all the ones that are needed to "get the job done" :) at the very least: edit / replace / remove image.
+1
Either being able to nest more blocks (especially columns) in the cover block; or adding background image and overlay to the groups block would be great.
Either being able to nest more blocks (especially columns) in the cover block; or adding background image and overlay to the groups block would be great.
Absolutely. It would be nice if a decision was made.
We discussed this in today's design meeting. It seems like there's a need for a background image option in the group block. However, at this point, it starts competing with the cover image block and I think it would be a good idea to have one type of block for both a start of a page post or a section with all forementioned functionality.