Gutenberg: Try adding left/right alignment controls to the spacer block

Created on 7 Jun 2019  路  4Comments  路  Source: WordPress/gutenberg

This was originally raised by @melchoyce in a DM. Squarespace has a spacer-type elmement that can be floated to the left or right. It may be interesting to try something like this out for Gutenberg too.

This feature can be helpful if a user wants to offset blocks and create non-standard layouts. These left/right spacers could theoretically be ignored on smalls screens, so the content would still be is full width there.

This is a super-rough hack, but to get the general idea across:

spacer

_(Ideally the right/left resize handles would only show up when the image is floated to the left or right though.)_

Needs Design Feedback [Block] Spacer [Type] Enhancement

Most helpful comment

I'm torn actually, adding that UI and functionality is not difficult - but as a user, having to do each of those steps to add space left or right of another block seems a bit heavy.

Some thoughts/suggestions on this implementation that could lighten up the UX:

  1. Maybe the left/right handles shouldn't render unless the block is left or right
  2. Only the opposite handle should show (_as you'd probably not drag the left side of the spacer to the left if its aligned left_)
  3. And what's the responsive considerations (if any?)

All 4 comments

This looks awesome! For accessibility the right / left handles would need an extra input field in the panel to add values. Something like this:

Vertical Spacer Settings

I'm torn actually, adding that UI and functionality is not difficult - but as a user, having to do each of those steps to add space left or right of another block seems a bit heavy.

Some thoughts/suggestions on this implementation that could lighten up the UX:

  1. Maybe the left/right handles shouldn't render unless the block is left or right
  2. Only the opposite handle should show (_as you'd probably not drag the left side of the spacer to the left if its aligned left_)
  3. And what's the responsive considerations (if any?)

At its core, this issue is meant to easily create columns of content from existing content. As an alternate approach to this, I opened a "Transform to Columns" issue here: https://github.com/WordPress/gutenberg/issues/16504

It's not exactly the same, but does accomplish a similar goal: put stuff into columns.

After a discussion with the design team, we decided that the improvement of the Columns block with a drag capability, is the way to go here.

Was this page helpful?
0 / 5 - 0 ratings