Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flex-basis, flex-grow and flex-shrink for IE10 by adding -ms-flex-preferred-size, -ms-flex-positive and -ms-flex-negative #299

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions lib/nib/flex.styl
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,17 @@ flex-grow(growth)

// new
if flex in flex-version
vendor('flex-positive', arguments, only: ms)
vendor('flex-grow', arguments, only: webkit official)

flex-basis()
if flex in flex-version
vendor('flex-preferred-size', arguments, only: ms)
vendor('flex-basis', arguments, only: webkit official)

flex-shrink()
if flex in flex-version
vendor('flex-negative', arguments, only: ms)
vendor('flex-shrink', arguments, only: webkit official)

flex(growth)
Expand Down
22 changes: 22 additions & 0 deletions test/cases/flex.css
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ section {
display: -ms-inline-flexbox !important;
display: inline-box !important;
}
section {
-webkit-box-flex: 1;
-moz-box-flex: 1;
-o-box-flex: 1;
-ms-box-flex: 1;
box-flex: 1;
}
section {
display: -webkit-flex;
display: flex;
Expand All @@ -269,3 +276,18 @@ section {
display: -webkit-inline-flex !important;
display: inline-flex !important;
}
section {
-ms-flex-positive: 1;
-webkit-flex-grow: 1;
flex-grow: 1;
}
section {
-ms-flex-negative: 0;
-webkit-flex-shrink: 0;
flex-shrink: 0;
}
section {
-ms-flex-preferred-size: 50%;
-webkit-flex-basis: 50%;
flex-basis: 50%;
}
12 changes: 12 additions & 0 deletions test/cases/flex.styl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ section
section
display: inline-flex !important

section
flex-grow 1

// New property conditional rendering
flex-version = flex

Expand All @@ -90,3 +93,12 @@ section

section
display: inline-flex !important

section
flex-grow 1

section
flex-shrink 0

section
flex-basis 50%