The upcoming Section Block supports wide
and full-width
alignment settings.
After much discussion, it was decided that Blocks that are children of Section should default to standard alignment even if the parent Section itself has full
or wide
alignments.
This is (partly) because not _all_ Blocks support alignment settings. For example you can place an Image Block within a full-width Section Block and change its [the Image's] alignment between full, wide or default. However you cannot do the same with the paragraph Block as it does not support alignment meaning it always sits in the center - this maybe what you want or it may _not_ be. Either way, you cannot control it!
When Section lands (soon!) it will be important that _all_ Blocks can be aligned. One way to achieve this is to add alignment controls to _all_ Blocks by default. The CSS to handle this within the Editor is already available.
You might think it would be possible to nest Section Blocks to work around this. It's not. Remember that by default all Blocks without alignment controls are set to remain at the _default_ width even if their parent Section is in full
or wide
mode.
As it currently stands, blocks have one of two different types of alignment options.
There's text alignments, used primarily by text-ish elements like the paragraph, and block alignments, used primarily by media elements:
Adding block alignments to all blocks has the potential to create a lot of noise (five extra alignment buttons, potentially sitting next to pre-existing alignment buttons) without necessarily providing any immediate user value. Given the unexpectedness of float behaviours in general, it's probably best we avoid exposing these on all blocks.
In most cases, I'd imagine that users would get the best results (especially in terms of readability) if text blocks (headings, paragraphs, etc) nested inside the section block retained the overall content-width as their max-width and remained centered in the section, like so:
What sorts of use cases would demand per-block alignments within the section block? I wonder if these settings might be best considered as advanced controls, and thus coralled into the block inspector...
@sarahmonster Luckily this is exactly what the new section
Block does.
I now agree that adding to all Blocks would be OTT. Thank you for your feedback 馃憤
A use case was raised at https://github.com/WordPress/gutenberg/issues/14811#issuecomment-485509797 by @strarsis where it may be reasonable to allow for the "Group" block specifically to allow for additional alignment options. It could be considered as the alternative to what was originally proposed here, that instead of adding alignment options to all blocks, add all alignment options to the Group block, where any block could be inserted into a Group block to achieve the desired alignment effect.
I was originally inclined to open a new issue, though am mindful of the conversation here. Do you think it would make sense to create an issue, or to reopen / re-focus this one?
For consistency I find it better to have the same alignment options for all the blocks.
Hey
For instance I noticed today as I am working on a site that reusable buttons does not have alignment options. https://github.com/WordPress/gutenberg/issues/17640
Adding custom html such as a Google map the html block does not have alignment options.
For blocks that do not have alignment it seems one has these options:
I just noticed that the Group
(formerly Section
) Gutenberg core block doesn't have left
, center
, right
alignment options. This is a very necessary setting because sometimes I want the group aligned at the left or centered and sometimes to the right. It should be possible to combine left
, center
, right
alignment and wide
/full
alignment options.
Most helpful comment
I just noticed that the
Group
(formerlySection
) Gutenberg core block doesn't haveleft
,center
,right
alignment options. This is a very necessary setting because sometimes I want the group aligned at the left or centered and sometimes to the right. It should be possible to combineleft
,center
,right
alignment andwide
/full
alignment options.