Closed douglas-johnson closed 7 months ago
@douglas-johnson the solutions that I've seen for something like this involved adding a new control panel to certain blocks. Was there a different way to achieve this that you had in mind?
@jessica-townsend I think that sounds right, can you show me an example?
I have an unrefined solution for this here: https://github.com/thoughtis/cata-blocks/blob/issue%23122/flex-grow-control/block-editor/src/index.js
This adds a Flex Grow attribute to all group blocks, but only displays an input field under dimensions
if the block's parent has a flex
layout and the block's width is set to fixed
. An inline style gets added in the editor and on the frontend. Let me know what you think about this so far @douglas-johnson
@jessica-townsend I'm not able to see the control in the editor, what am I missing?
@douglas-johnson the control is currently only applied to group blocks, so the block structure should be like this
I set the flex-grow on these two headings in a Row, then I switched them to Fit instead of Fixed. I expected the flex-grow value to get reset to null, but it was still there in the output.
The controls for the flex layout type allow, fit, fill and fixed sizes. We really need fixed and fill to work together. We run into multiple layouts that would benefit from support for uses cases like "20em by default and grow to fill the available space".