Skip to content

Instantly share code, notes, and snippets.

@thamas
Created March 19, 2019 20:43
Show Gist options
  • Save thamas/928be173a4e42f98a4482d3c38050e7f to your computer and use it in GitHub Desktop.
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)
// 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;
}
}
}
}
@thamas
Copy link
Author

thamas commented Mar 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment