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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 28 May 2010 14:19:20 -0700
Message-ID: <AANLkTimwabvi7piBeQFq2lBVRuwMPrf7nTHbqaDo_X3v@mail.gmail.com>
To: Alex Mogilevsky <alexmog@microsoft.com>
Cc: www-style list <www-style@w3.org>
On Thu, May 27, 2010 at 10:31 PM, Alex Mogilevsky <alexmog@microsoft.com> wrote:
>> -----Original Message-----
>> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]
>> Sent: Wednesday, May 26, 2010 5:43 PM
>>
>> > ·         How does max-height on items affect alignment and box height?
>>
>> max-height *should* be honored, and have no special effect on any other
>> child or the flexbox as a whole.  Unfortunately box-align isn't clear on exactly
>> what length it increases to do its align:stretch.  If it's increasing height
>> directly, then max-height should take effect, and we need to clarify how
>> things are aligned when they can't be fully stretched.  If it's increasing
>> padding-bottom, then max-height won't have any effect (unless you change
>> box-sizing, and then we're in the previous situation).  If it's doing something
>> more magical, then there's no way to tell - we just need to decide by fiat
>> what the correct behavior is.
>
> I see arguments both ways...
> (all considerations below focus on a horizontal Flexbox; in vertical same applies to width/max-width/min-width)
>
> (1) For ignoring max-height:
>
> Max-width/max-height are important properties in text layout, but Flexbox is an independent subsystem, it *is meant to be simple* and it gets to set its own rules on what properties to take into consideration. Obviously it has to know about padding (otherwise width has no meaning, unless you are in quirks mode), but it would be totally fine to ignore max-height if it doesn't make much difference inside Flexbox. Just as well max-width doesn't have a meaning on a table cell.

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.)


> (2) For using max-height:
>
> We obviously need to honor min-height. Also, max-width is honored in flex distribution, it even calls for a flex-group property to deal with it. It would be odd to handle 5 width/height properties out of 6.

Right, that's the "more confusing if it's left out than if it's left in" thing.


> (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.

~TJ
Received on Friday, 28 May 2010 21:20:15 GMT

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