Skip to content

Instantly share code, notes, and snippets.

@barning
Last active May 28, 2019 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barning/ed0cc626e7699ad4ff10f5a3bdeffb4c to your computer and use it in GitHub Desktop.
Save barning/ed0cc626e7699ad4ff10f5a3bdeffb4c to your computer and use it in GitHub Desktop.
Generating css grid for IE and browsers we really love
@mixin cssGrid {
display: -ms-grid;
display: grid;
}
@mixin cssGridTemplateCol($input) {
-ms-grid-columns: #{$input};
grid-template-columns: #{$input};
}
@mixin cssGridTemplateRow($input) {
-ms-grid-rows: #{$input};
grid-template-rows: #{$input};
}
@mixin cssGridRow($start, $end: null) {
-ms-grid-row: $start;
@if $end {
-ms-grid-row-span: $end - $start;
grid-row: #{$start}/#{$end};
} @else {
-ms-grid-row-span: 1;
grid-row: #{$start};
}
}
@mixin cssGridCol($start, $end: null) {
-ms-grid-column: $start;
@if $end {
-ms-grid-column-span: $end - $start;
grid-column: #{$start}/#{$end};
} @else {
-ms-grid-column-span: 1;
grid-column: #{$start};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment