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

Add "stretch" as option on Row block. #41280

Closed
johnstonphilip opened this issue May 24, 2022 · 4 comments
Closed

Add "stretch" as option on Row block. #41280

johnstonphilip opened this issue May 24, 2022 · 4 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

@johnstonphilip
Copy link
Contributor

What problem does this address?

It's currently not possible to use align-items:stretch to make items inside a row block vertically fill the space available.

While stretch is the default for a flex item in CSS, I am not able to use that in the block editor.
Screen Shot 2022-05-23 at 4 52 17 PM

What is your proposed solution?

Add "stretch" to the available options, alongside Align top, Align middle, and Align bottom.

const BLOCK_ALIGNMENTS_CONTROLS = {
top: {
icon: alignTop,
title: _x( 'Align top', 'Block vertical alignment setting' ),
},
center: {
icon: alignCenter,
title: _x( 'Align middle', 'Block vertical alignment setting' ),
},
bottom: {
icon: alignBottom,
title: _x( 'Align bottom', 'Block vertical alignment setting' ),
},
};

@johnstonphilip johnstonphilip added the [Feature] Blocks Overall functionality of blocks label May 24, 2022
@mtias mtias added the [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi label May 24, 2022
@karmatosed
Copy link
Member

My thought around this is perhaps the naming. Would calling it something like 'fill' mean more to not just developers?

@kathrynwp kathrynwp added [Block] Group Affects the Group Block [Type] Enhancement A suggestion for improvement. and removed [Feature] Blocks Overall functionality of blocks [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Nov 23, 2022
@cbirdsong
Copy link

This would also be good to add on the Stack block, as outlined in #46008.

@willybahuaud
Copy link
Contributor

I think the problem is in the editor style. Il you look at the column block, it's stretched by default. But in the group (layout row) the css rules are :

.editor-styles-wrapper .is-layout-flex{align-items:center}
body .is-layout-flex{align-items:center}

I don't know why this is so. After changing the style, the only persistent effect is that the "centered" icon remains grayed out even if it is not checked.

Can someone explain us why centered is set by default here?

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

Closing as "stretch" has been added in #47134.

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.
Projects
None yet
Development

No branches or pull requests

7 participants