Skip to content

Instantly share code, notes, and snippets.

@claudia-romano
Created July 20, 2018 10:32
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 claudia-romano/1871d3508a0991c33bd324b20f5dab6a to your computer and use it in GitHub Desktop.
Save claudia-romano/1871d3508a0991c33bd324b20f5dab6a to your computer and use it in GitHub Desktop.
@mixin gridLayout($cols...) {
@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;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment