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

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

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

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

What should we do?

Received on Friday, 28 May 2010 05:31:49 UTC