Created
March 19, 2019 20:43
-
-
Save thamas/928be173a4e42f98a4482d3c38050e7f to your computer and use it in GitHub Desktop.
Helper Sass mixin to place CSS Grid items into rows in Internet Explorer (11)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// There is no auto placement for CSS Grid items in IE. | |
// Sow we need to place the items into rows. | |
@mixin ie-grid-rows($start: 1, $rows: 50, $container: true, $shift: 0) { | |
@for $i from $start through $rows { | |
$row: $i - $shift; | |
@if $container { | |
> *:nth-child(#{$i}) { | |
-ms-grid-row: $row; | |
} | |
} | |
@else { | |
&:nth-child(#{$i}) { | |
-ms-grid-row: $row; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For more info see: http://thamas.hu/en/semi-auto-placement-of-css-grid-items-in-internet-explorer-11/