Re: [css-flexbox]

On Tue, Sep 16, 2014 at 1:48 AM, Nick Manning <nmanning@inc.com> wrote:
> I have a suggestion for flex box. Can there be a max-lines or max-rows
> attribute? What if I have a flex box (justify-content:space-between) with n
> flex items whose widths are determined by the text inside. As the browser
> shrinks to the point where there is no more space in between the flex-items,
> you want it to wrap to two rows of items. No problem, just apply
> flex-wrap:wrap,...but then when you shrink the flexbox further, once this
> double rowed flexbox has no more space in between the flex-items, you do not
> want it to wrap to three rows---rather you want it to begin to shrink the
> flex-items themselves. You can't change to flex-wrap:nowrap because then it
> will go back to one row. The only option is to use javascript.
>
> This problem could be solved with the following elegant style:
>
> .container {
>   display: flex;
>   justify-content: space-between;
>   flex-wrap: wrap;
>   max-rows:2;
> }
>
> Thanks!

Seems pretty reasonable!  The current draft of Flexbox is frozen, and
only accepting bugfixes, but I maintain a list of ideas for Flexbox
level 2 at <http://wiki.csswg.org/spec/css-flexbox-2>, and have added
yours to the list.

~TJ

Received on Wednesday, 17 September 2014 19:24:47 UTC