Last active
May 28, 2019 11:56
-
-
Save barning/ed0cc626e7699ad4ff10f5a3bdeffb4c to your computer and use it in GitHub Desktop.
Generating css grid for IE and browsers we really love
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
@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