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

± 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 UTC