gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Group Block - add support for Background Images

Open getdave opened this issue 7 years ago • 67 comments

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 cover Block) (thanks to @SchneiderSam )

Considerations

  • Would this bring the Block too close to the current cover Block? Or should we encourage users to utilise a cover Block within a section to achieve this?

getdave avatar Apr 01 '19 13:04 getdave

Great would be in this move also a color overlay as with the Cover Block.

SchneiderSam avatar Apr 01 '19 13:04 SchneiderSam

Yeah, I'm not sure about this as this will just be a cover block in the end if we do this.

youknowriad avatar Apr 02 '19 07:04 youknowriad

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!

SchneiderSam avatar Apr 02 '19 10:04 SchneiderSam

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".

youknowriad avatar Apr 02 '19 10:04 youknowriad

Ok. Sorry!

SchneiderSam avatar Apr 02 '19 11:04 SchneiderSam

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.

oxyc avatar Apr 03 '19 23:04 oxyc

Why not use the cover block if the aim is to have a background image ?

truchot avatar Apr 28 '19 21:04 truchot

@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.

bbertucc avatar May 07 '19 19:05 bbertucc

@truchot - the cover block doesn't support nested blocks.

Yes it does :)

  1. You can install Gutenberg as a plugin to get last features
  2. Or wait WordPress 5.2 that will be released very soon

truchot avatar May 07 '19 19:05 truchot

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

bbertucc avatar May 07 '19 19:05 bbertucc

Mockups:

Image Color

(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?

melchoyce avatar May 15 '19 15:05 melchoyce

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!

SchneiderSam avatar May 15 '19 17:05 SchneiderSam

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.

getdave avatar May 22 '19 15:05 getdave

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.

afercia avatar May 24 '19 14:05 afercia

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?

melchoyce avatar May 24 '19 14:05 melchoyce

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.

afercia avatar May 24 '19 16:05 afercia

+1

klihelp avatar Jun 10 '19 18:06 klihelp

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.

LyleBennett avatar Jun 12 '19 15:06 LyleBennett

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.

SchneiderSam avatar Jun 12 '19 16:06 SchneiderSam

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.

boemedia avatar Jun 12 '19 19:06 boemedia