Created
July 20, 2018 10:34
-
-
Save claudia-romano/6bfec84a3c3b09d815ef11d1b7f93d1a to your computer and use it in GitHub Desktop.
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 gridLayout($cols...) { | |
$i: 1; | |
@each $col in $cols { | |
> :nth-of-type(#{$i}) { | |
width: calc( #{round-width(nth($col,1))} - #{$gap-horizontal}); | |
} | |
$i: $i + 1; | |
} | |
@supports(grid-area: auto) { | |
grid-template-columns: repeat($grid-columns, 1fr); | |
$i: 1; | |
@each $col in $cols { | |
> :nth-of-type(#{$i}) { | |
grid-column-end: span nth($col,1); | |
@if length($col) > 1 { | |
grid-row-end: span nth($col,2); | |
} | |
} | |
$i: $i + 1; | |
} | |
> :nth-child(n) { | |
width: auto; | |
margin: 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment