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

RE: [css3-flexbox] ED updated: algorithms and 'flex' property

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Tue, 28 Feb 2012 22:38:50 +0000
To: Tony Chang <tony@chromium.org>
CC: Tab Atkins Jr. <jackalmage@gmail.com>, "www-style@w3.org list" <www-style@w3.org>
Message-ID: <D51C9E849DDD0D4EA38C2E539856928412EB4120@TK5EX14MBXC214.redmond.corp.microsoft.com>
± From: tc@google.com [mailto:tc@google.com] On Behalf Of Tony Chang
± Sent: Tuesday, February 21, 2012 4:19 PM
± To: Alex Mogilevsky
± New proposal:
± Have the initial value of flex be none or noflex.  none/noflex means 0 positive flex, 
± 0 negative flex, and use the value of width or height for sizing.  Also, drop the 
± special meaning of auto for the preferred size.  Which is to say, if you specify a 
± flex value at all, then width/height will be ignored.
± This feels more explicit to me and avoids having auto for a length value have a 
± different meaning.

Maybe it would be more cleaner if flex preferred size didn't refer to other properties, but when "preferred size" is the natural width, it is not reasonable to ignore specified width.

Here is an example:

Suppose you have some images as flex items:

	.filmstrip { display:flexbox; }
	.filmstrip > img { flex:1 auto; }

that says "use image intrinsic size as preferred size, let it grow if space allows but don't shrink". Sounds useful?

Now, what if the image doesn't have an intrinsic size and it has a size that is set in content, perhaps by a server that you don't own?

	<img class="thumbnail" src="img1001.jpg" style="width:200px; height:150px">		<img class="thumbnail" src="img1001.jpg" style="width:150px; height:200px">		<img class="thumbnail" src="img1001.jpg" style="width:180px; height:180px">		...

The specified width and height are very relevant. Then we have to be able to use it.

On the other point, if 'auto' is not the best name for "use specified width/height", we could come up with a different keyword. But... 'auto' is already a valid value for 'width', it has to mean something here, if we use a different keyword we have to define what it is (or isn't). I think 'auto' is not that bad for the purpose...

Received on Tuesday, 28 February 2012 22:39:36 UTC

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