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

RE: [css3-flexbox] flex-grow initial value should be 0px

From: Alex Mogilevsky <alexmog@microsoft.com>
Date: Wed, 6 Jun 2012 17:26:53 +0000
To: Morten Stenshorne <mstensho@opera.com>, Tab Atkins Jr. <jackalmage@gmail.com>
CC: Daniel Holbert <dholbert@mozilla.com>, fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <2C86A15F63CD734EB1D846A0BA4E0FC823CB0D2D@CH1PRD0310MB381.namprd03.prod.outlook.com>
 From: Morten Stenshorne [mailto:mstensho@opera.com] 
 Sent: Wednesday, June 06, 2012 1:06 AM
 
 As an implementor, I have no strong opinions (they are obviously equally 
 easy to implement), but apart from that, I must say I like things that are 
 clear and stupid, and at least not smarter than me. :)

Exactly what I feel as an author. I prefer consistent over convenient too.

 Another issue being discussed in this thread, regarding the case where only 
 one <number> being supplied in the 'flex' property: I prefer that it apply 
 to both growing and shrinking, FWIW.

Now that "0 1 auto" has been voted in and special case for "flex:0" dismissed (reasonable, considering the new default), I think there is still a way to make the whole thing at least somewhat sensible:

	1) initial: "flex:0 1 auto"
		("flex-basis:auto; flex-grow:0; flex-shrink:1;")

	2) defaults in flex shortcut match initial values:
		"flex:auto" == "flex:0 1 auto"
		"flex:1" == "flex:1 1 auto"	   
		"flex:0" == "flex:0 1 auto"	   
		"flex:0 0" == "flex:0 0 auto"	   
		"flex:1 0" == "flex:1 0 auto"	   
		"flex:100px" == "flex:0 1 100px"		
		"flex:0px" == "flex:0px"

Yes, "relative flex" is a little easier to get:

	.flex0 { flex:0 }	
	.flex1 { flex:1 }

While for "absolute flex" you have to say you want to drop flex-basis to 0:

	.flex0 { flex:0 }	
	.flex1 { flex:1 0px }

But that's ***OK*** -- it is still easy to set flex-basis to whatever you want it to be, but default of "0px" really makes no sense for inflexible items, which have been the source of endless issues.

Alex


 
Received on Wednesday, 6 June 2012 17:29:33 GMT

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