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

Replicate Figma's "Auto Layout" feature for containing blocks #21494

Closed
Tracked by #33447
enriquesanchez opened this issue Apr 8, 2020 · 4 comments
Closed
Tracked by #33447

Replicate Figma's "Auto Layout" feature for containing blocks #21494

enriquesanchez opened this issue Apr 8, 2020 · 4 comments
Labels
[Block] Columns Affects the Columns Block [Block] Group Affects the Group Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi

Comments

@enriquesanchez
Copy link
Contributor

Now that we've been working on creating block patterns, I'm finding that spacing, margins, and paddings are some of the hardest layout elements to manipulate.

While working on Figma, I couldn't help but think that it would be incredibly useful to have something similar to their Auto Layout feature in some of Gutenberg's blocks, particularly those that are used as "containers" (group, column, etc.).

The Auto Layout feature in Figma basically takes care of spacing and alignment of child items inside a frame (a frame in Figma is similar to what we call a group in Gutenberg).

The tool looks like this:

Screen Shot 2020-04-08 at 17 01 52

It allows for the setting of horizontal and vertical direction, horizontal and vertical padding, and spacing between child elements.

In practice, it looks like this:

2020-04-08 17-22-50 2020-04-08 17_25_27

Being able to manipulate these settings on a per-block basis would be very useful when creating custom layouts and patterns.

@enriquesanchez enriquesanchez added [Block] Columns Affects the Columns Block [Block] Group Affects the Group Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Apr 8, 2020
@ItsJonQ
Copy link

ItsJonQ commented Apr 14, 2020

Wow 😍

@talldan
Copy link
Contributor

talldan commented Jul 22, 2020

Something in discussion over in #23915 is how to let users incorporate different types of blocks into or alongside the Nav Block.

Horizontal layouts are pretty common on the web for site navigation, a user might want their navigation links on the left and a search form on the right. Something like this seems like it could solve the problem.

Options similar to flexbox's justify-content rule might also be useful (that might be something figma already has options for):
https://css-tricks.com/snippets/css/a-guide-to-flexbox/

@talldan
Copy link
Contributor

talldan commented Jul 22, 2020

Also related: #20141

@mtias
Copy link
Member

mtias commented Apr 10, 2022

I believe this is mostly already in place in flex based container — new blocks would fit in the horizontal or vertical layout, and they'd inherit the block spacing property. If there are any further improvements to be made we should consider them in new tasks.

@mtias mtias closed this as completed Apr 10, 2022
Repository owner moved this from ⏱ Not Started to ✅ Done in Design Tools Project Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Columns Affects the Columns Block [Block] Group Affects the Group Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi
Projects
Status: Done
Development

No branches or pull requests

4 participants