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

RE: [css3-flexbox] Handling 'auto' main sizes.

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Tue, 8 May 2012 02:51:54 +0000
To: Anton Prowse <prowse@moonhenge.net>, "www-style@w3.org" <www-style@w3.org>
CC: fantasai <fantasai.lists@inkedblade.net>
Message-ID: <2C86A15F63CD734EB1D846A0BA4E0FC81A3EDE01@CH1PRD0310MB381.namprd03.prod.outlook.com>
 From: Anton Prowse [mailto:prowse@moonhenge.net] 
 Sent: Thursday, April 26, 2012 5:23 AM
 > For example:
 > <flexbox> <div style="flex:0 1 auto">some amount of plain text</div>  
 > <div style="flex:0 1 auto">some different amount of plain text</div> 
 > </flexbox>
 > (there is enough text to be wider than available space if put 
 > together, so items will have to shrink)
 > In this case, should we expect that child with more text will get more 
 > space? It will, unless both children are wider than the space that 
 > would have been available if the other child were not there, which 
 > doesn't seem useful at all... Using 'max-content' for preferred size 
 > will get a more predictable behavior here.
 Assuming a small min-content width, 'max-content' is the same as 'fit-
 content' unless the max-content width is larger than the available 
 width.  So I'm assuming that in your example, the available width is 
 less than the max-content width of both the divs.  But then, 'fit-
 content' gives rise to flex basis equal to available width for both 
 items, where as 'max-content' gives rise to a different flex basis for 
 each flex item... which seems to be the opposite of what you're arguing! 

Maybe I didn't explain this well. Yes, the example implies that each item has max-content bigger than available space.

What I wanted to show is

1) If each item has max-content bigger than available space, actual content no longer affects the final size.

2) "available space" within flexbox is not really what is available to each item, unless it is a single-item row-direction flexbox. Clipping to that seems random. It would make one degenerate case work at the cost of losing valuable sizing information for many common cases.

I think 'max-content' is a better default for flex basis and in discussion with Fantasai and DHolbert we agreed that it is.

Received on Tuesday, 8 May 2012 02:53:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:16 UTC