Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover & Group blocks: Add Margin Control #38629

Closed
iamtakashi opened this issue Feb 8, 2022 · 2 comments · Fixed by #37344
Closed

Cover & Group blocks: Add Margin Control #38629

iamtakashi opened this issue Feb 8, 2022 · 2 comments · Fixed by #37344
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi

Comments

@iamtakashi
Copy link

It'd be nice to be able to control margins for Cover and Group blocks.

For example (the pink rectangle is illustrating the margin):

Screenshot 2022-02-08 at 14 22 11

With the vertical margin, the header looks taller than how it's intended.

Obviously, I can "fake" it by reducing the bottom padding in the header, but that doesn't feel right, and there will be a problem as soon as the user adds a background colour to the header.

What problem does this address?

It helps create designs with gapless "sections".

What is your proposed solution?

Add Margin control like Columns block

@richtabor richtabor added [Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Feb 8, 2022
@ndiego
Copy link
Member

ndiego commented Feb 8, 2022

I know there has been a TON of conversation about adding dimension controls to blocks, specifically margin. But I think a happy compromise could be adding margin to "container" blocks. The Columns block already supports margin and adding this to Group and Cover would solve many edge cases. This would go a long way in solving issues like this ticket which are impeding many FSE designs. If we can get some consensus on this, I will drop everything and write the PRs myself 😉

@ndiego ndiego linked a pull request Feb 9, 2022 that will close this issue
@ndiego ndiego linked a pull request Feb 9, 2022 that will close this issue
7 tasks
@jasmussen
Copy link
Contributor

We've certainly been back and forth on this. Also enough at this point, probably, that we could look at some changes to the approach. Here's a thought:

  • We add margin to a few blocks, like Cover and Group for start.
  • It's added as a not-shown-by-default option in the ToolsPanel.
  • This addition should not block further explorations, notably in-canvas improvements like outlined in Contextual Block Padding (Spacing) Controls #33221.

The reason to move carefully, as stated over many issues, is that margins are difficult. They are hidden, they collapse, they can't easily be copy/pasted, or have presets.

From this Figma, here's an older mockup for what an inspector margin control could look like:
Spacing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block (and row, stack and grid variants) [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants