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

Flex Layout: Add "stretch" alignment option #46008

Closed
cbirdsong opened this issue Nov 23, 2022 · 5 comments
Closed

Flex Layout: Add "stretch" alignment option #46008

cbirdsong opened this issue Nov 23, 2022 · 5 comments
Labels
[Block] Group Affects the Group Block [Feature] Layout Layout block support, its UI controls, and style output. [Type] Enhancement A suggestion for improvement.

Comments

@cbirdsong
Copy link

cbirdsong commented Nov 23, 2022

What problem does this address?

For vertical alignment, the row layout defaults to align-items: center; and the stack layout defaults to align-items: flex-start;, resulting in this layout:

A set of paragraphs aligned to the left edge of the container when laid out vertically, and aligned to the center of the container when laid out horizontally

The existing alignment options only allow you to adjust the position of the container's children to top/middle/bottom or left/center/right, but you can't set them to fill the container.

What is your proposed solution?

Add a "stretch" layout option (align-items: stretch) so you can ensure the flex children always fill the container, like this:

A set of paragraphs that fill the container horizontally when laid out vertically, and fill the container vertically when laid out horizontally

Codepen example: https://codepen.io/cbirdsong/pen/KKeoqOq

@kathrynwp kathrynwp added [Type] Enhancement A suggestion for improvement. [Feature] Blocks Overall functionality of blocks labels Nov 23, 2022
@kathrynwp
Copy link

Hey there @cbirdsong I think this may be a duplicate of #41280 so I'm going ahead and closing this, but if I'm mistaken, please let me know and I'll have another look. Thanks!

@kathrynwp kathrynwp closed this as not planned Won't fix, can't repro, duplicate, stale Nov 23, 2022
@kathrynwp kathrynwp added [Block] Group Affects the Group Block and removed [Feature] Blocks Overall functionality of blocks labels Nov 23, 2022
@cbirdsong
Copy link
Author

Yeah, pretty much, though I was thinking about this more broadly than the row/stack blocks? Ideally this would also apply to buttons and anywhere else that uses flex layout.

Also, should these have the "[Feature] Layout" label? That is where I looked for duplicates before filing this.

@kathrynwp kathrynwp added the [Feature] Layout Layout block support, its UI controls, and style output. label Dec 13, 2022
@kathrynwp kathrynwp reopened this Dec 13, 2022
@kathrynwp
Copy link

I went ahead and reopened this issue and added the tag you suggested to both this issue and the older one. Thanks a lot, @cbirdsong!

@phil-sola
Copy link

I agree this would be a welcome addition to any flex settings. +1 from me

@tellthemachines
Copy link
Contributor

Closing as "stretch" has now been added for all flex layouts in #47134 (In horizontal orientation it's in the alignment options, and in vertical in the justification options).

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 [Feature] Layout Layout block support, its UI controls, and style output. [Type] Enhancement A suggestion for improvement.
4 participants