stylus / nib

Stylus mixins, utilities, components, and gradient image generation
http://stylus.github.io/nib
MIT License
1.91k stars 249 forks source link

Fix "-ms-flex: auto" #230

Closed candid82 closed 4 years ago

candid82 commented 10 years ago

flex: auto should be translated to -ms-flex: 1 1 auto because -ms-flex: auto is interpreted as -ms-flex: 1 0 auto by IE 10.

notslang commented 9 years ago

I'm having a hard time finding documentation about this IE 10 bug. Could you point me to some writeup about the existence of the quirk or documentation about what IE 10 reads -ms-flex: auto as?

candid82 commented 9 years ago

http://msdn.microsoft.com/en-us/library/ie/jj127297(v=vs.85).aspx

candid82 commented 9 years ago

Hum... Just noticed this at the bottom of that document: "The third flex item has auto defined for the flex property. This is equivalent to flex: 1 1 auto.". This kind of conflicts with "if omitted" behavior specified for flex-grow and flex-shrink parts, but I guess this issue is fixed in IE11. Older document for the prefixed version (supported by IE10) doesn't mention anything about "flex: auto" case: http://msdn.microsoft.com/en-us/library/ie/hh673531(v=vs.85).aspx. I definitely saw this issue in IE10. Unfortunately I no longer have a test environment for IE10, so cannot double check.

notslang commented 9 years ago

ah, this is noted on http://caniuse.com/#feat=flexbox:

IE10 and IE11 default values for flex are 0 0 auto rather than 0 1 auto, as per the draft spec, as of September 2013.

And this question on StackOverflow: http://stackoverflow.com/questions/16808815/ie10-flexbox-p-element-non-wrapping

notslang commented 9 years ago

So, I think that if the default is 0 1 auto we should be applying that (not 1 1 auto), right?

candid82 commented 9 years ago

It's been a while since I looked at this issue, but I think default != auto. According to the MDN, auto means 1 1 main-size (they changed auto to main-size since last time I read it.... sigh). I guess the closest to that would be to translate auto to 1 1 auto in IE 10.