Skip to content

Contextual Block Padding (Spacing) Controls #33221

Closed

Description

@richtabor

What problem does this address?

As the block content area is the primary level of interaction, let's consider exploring how we could empower site publishers to design with contextual spacing controls within the blocks themselves.

  • This could work for padding, and probably margin as well.
  • We could implement keyboard shortcuts for modifying X/Y/all values at a time (similar to Figma/Photoshop/etc).

What is your proposed solution?

Having a hover area the size of the current padding, that can be dragged to a specific size. The existing control within the Spacing PanelBody should reflect the changes. I should be able to utilize keyboard shortcuts to drag both X values at a time, or both Y values, or even all values.

I drew up some explorations below for us to maybe jive on if we're down.

Video:

padding.mp4

Screenshots:

Screen Shot 2021-07-06 at 10 20 33 AM

Screen Shot 2021-07-06 at 10 20 46 AM

Screen Shot 2021-07-06 at 10 20 58 AM

Prototype:

https://www.figma.com/proto/ETa2dTgPUjltCOEQNnceUI/Gutenberg-Explorations?page-id=14%3A2&node-id=17%3A15&viewport=1634%2C2708%2C1&scaling=min-zoom

Activity

  1. added
    Needs Design Feedback
    [Block] Group
    on Jul 6, 2021
  2. karmatosed commented on Jul 7, 2021

    @karmatosed
    Member

    I really like this idea. Specifically, I like that it fits into a flow of someone interacting using the keyboard because it's a power feature accessed through a power command (using key combination). This means it's out of the way for many - which feels even better.

  3. mtias commented on Jul 8, 2021

    @mtias
    Member

    Just referencing that a similar treatment is currently in place for the Cover block. It needs to be refined and rolled out to the other blocks that support padding.

    Screeny.Video.8.Jul.2021.at.11.54.59.mov
  4. added
    [Feature] Design Tools
    on Jul 27, 2021
  5. paaljoachim commented on Aug 24, 2021

    @paaljoachim
    Contributor

    It seems that the initial approach is getting the similar treatment that is now in place for the Cover block into other blocks. Then we can begin looking at how to make the approach contain a more practical visual and interaction.

  6. fwazeter commented on Aug 24, 2021

    @fwazeter
    Member

    Slack Discussion Thread on the Topic.

    Overall thoughts are that having a visual way, possibly with short cut keys, to adjust margin/padding would enhance the user experience with content editing.

    My commentary:

    I think as a general design pattern, that having the text input areas available is necessary for obvious reasons. That said, they fall short in two places:

    1. As a developer, it almost ends up faster to just make those changes in a stylesheet / in code directly, so in doing agency work, you almost always feel slower having to input stuff on an editor in text fields.
    2. They're not always intuitively findable by a user, even one with experience with the platform (and easy to forget about).

    Spacing is almost always one of those annoying "gotchas" when trying to have a uniform layout across a site.

    Having a visual way to edit things, like the proposal, feels faster to use and allows for easier visual representation of spacing between elements. Plus, for end users, visual mechanisms tend to almost always be viewed as simpler to use / manage / edit.

    Joyously made the great point that spacing being one of the most common gotchas is the reason why a user shouldn't have access to change it.

    It's a good point and is similar to how users will break accessibility/content hierarchy by using a different header tag because they want font size to be larger or smaller.

    The general thought to address that is to have it as an option that's enabled via global styles / settings, so that theme authors could make the decision on what they allow or not, with the thinking that eventually there will likely be a way for site admins to have settings available to them, but not available / locked for other users.

  7. moved this to ⏱ Not Started in Design Tools Projecton Nov 2, 2021
  8. mtias commented on May 23, 2022

    @mtias
    Member

    Closing as done in #40505.

  9. Repository owner moved this from ⏱ Not Started to ✅ Done in Design Tools Projecton May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs Design Feedback[Block] Group[Feature] Design Tools

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions