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: Wed, 29 Feb 2012 00:06:59 +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: <D51C9E849DDD0D4EA38C2E539856928412EB4BF0@TK5EX14MBXC214.redmond.corp.microsoft.com>
± From: tc@google.com [mailto:tc@google.com] On Behalf Of Tony Chang
± Sent: Tuesday, February 28, 2012 3:03 PM
± What if you wanted to do intrinsic sizing to override the inline styles? In 
± other words, you want 'flex: 1 auto' to force a preferred size of auto.  It 
± might work to do something like 'width: auto !important', but that wouldn't be 
± necessary if auto for preferred size meant auto.

This would work:

	"flex: 1 max-content"

Or 'fit-content', or whatever you wanted as intrinsic size.

± I guess I find this confusing because 'auto' already has a meaning when talking 
± about a size, but you're proposing that we give it a different meaning for 
± preferred size.

Yes, I have a problem with referring to "preferred size" with whatever keyword and then ignoring width and height properties, which can't possibly mean anything other than a strong preference for size.

What would be a use case where it is important to ignore width (assuming that that width would be meaningful in some other layout model, like table or normal flow)?

± If we have to keep this fallback behavior, we should just use a different 
± keyword.  The example you provided doesn't seem like it would be that common, 
± which is why I would be in favor of not having a fallback option.

This is a "fallback behavior". 'flex' property has a way to override specified width, typically with zero, because "preferred size" as a "base for flex distribution" is not always the content size.

Note BTW that when 'flex' property is not specified at all, 'width' and 'height' have to work. That is the size. Adding flexibility shouldn't abandon the inflexible size (even though it is done by choice in some common cases).

My preference BTW, just in case I haven't said before, to not have preferred size in 'flex' property at all. It is there because "flex:1; width:0;" is supposedly not intuitive. 

Perhaps "flex:1; flex-preferred-size:0; width:<ignored>;" would work better - it is more verbose, but totally clear and doesn't involve funky defaults.


Received on Wednesday, 29 February 2012 00:07:39 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:56 UTC