block-options
block-options copied to clipboard
Add alignment (left, center, right) options to group block
The core/group
block only offers wide
and full
alignment options,
no left
, center
and right
alignment options which many other blocks offer.
This would be very useful, for example I want a group sometimes to the right, but on its own line.
If I put it into a columns block, the left column would have to be emtpy.
With CSS this would be trivial (e.g. margin-left: auto; margin-right: 0;
for right
alignment).
@strarsis Thanks a lot for the suggestion, unfortunately this feature won't work well on Group Block until they added width control on it. Thanks again!
@phpbits: Doesn't the group block now have width control?
I can already select wide
or full
(or none) on a core group block in latest WordPress (and Gutenberg).
@strarsis Yeah but it's a layout control not width
control like image resizable width. Having the width will make the positioning better. I'm still checking out if there are any other possible ways but for the meantime the width is necessary. Thanks!
@phpbits: For one theme I use the wide
option for a group block to have it extend its outmost wrapper element to full width for its background, but still have its content wrapper width-constrained.
Now I can easily align the content wrapper by applying CSS margin-left
/margin-right
auto
/0
,
but there is no UI for this in Gutenberg editor.