W3C home > Mailing lists > Public > www-style@w3.org > June 2010

Re: [css3-flexbox] max-height and box-align (RE: flexbox questions)

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 1 Jun 2010 18:24:42 -0700
Message-ID: <AANLkTimJ1-pJ73HjHbqp8dEg4waKjukwJSYsUvoMxFBt@mail.gmail.com>
To: Alex Mogilevsky <alexmog@microsoft.com>
Cc: www-style list <www-style@w3.org>
On Tue, Jun 1, 2010 at 6:14 PM, Alex Mogilevsky <alexmog@microsoft.com> wrote:
>> -----Original Message-----
>> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
>> Sent: Friday, May 28, 2010 2:19 PM
>>
>> The fact that max-height doesn't work on a table-cell is actually really
>> confusing.  ^_^  We certainly don't need to map over every concept from
>> normal flow into new flow modes, but some things are so simple that *not*
>> mapping them over causes more confusion than just doing it.  (For tables,
>> frex, an ideal solution would involve resolving maximum heights as some
>> combination of the max-height of the cell, its siblings, and its row.)
>
> I am not sure what is confusing about max-width or max-height not restricting column width or row height. If something is a cell in a grid it has to match the grid size, which adds more settings, and the more settings you have the easier it is to get overspecified. It seems reasonable that the table has final say on cell sizes. It will respect min-width, but may brow beyond max-width. If that is reasonable for a grid (I think it is) it should be reasonable for a flex-box.

It's possibly reasonable, but that doesn't mean it can't be confusing
too.  ^_^  Having max-height ever be ignored is somewhat confusing to
me.


>> > (3) Yet another option:
>> >
>> > Drop box-flex-group.
>> > Max-width (for horizontal) tramps the content width, but the outcome is
>> simply an input into flex distribution, just like in tables (that is what I think
>> tables do, correct me if I am wrong).
>> > Max-height also overrides content height but then height can be increased
>> by stretch alignment.
>>
>> Ah, so max-height just provides a limit for the height before flex
>> computation.  That's a possibility.  I'd want min-height to work the same way,
>> though, along with min/max-width.
>
> This is interesting to explore. You have shown in use cases that if equal size is desired (a.k.a. absolute flex) it can be done by using width:0, but then it is much harder or impossible to apply min-width (e.g. not shrink beyond content width).

In current implementations, at least, that doesn't actually work (I
talk about that in use case #20 that I'm not sure if it's an impl bug
or a spec bug).  Even if you set width:0, Firefox still uses the
min-content width of the box as the preferred size for flex
calculations.

You're right, though, that doing so then makes it difficult to use min-width.

~TJ
Received on Wednesday, 2 June 2010 01:25:36 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:28 GMT