Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save claudia-romano/9e54d2a909440b54408fed6cc6ad43b5 to your computer and use it in GitHub Desktop.
Save claudia-romano/9e54d2a909440b54408fed6cc6ad43b5 to your computer and use it in GitHub Desktop.
@mixin gridAdvanced($cols...) {
@supports(grid-area: auto) {
grid-template-columns: repeat($grid-columns, 1fr);
$i: 1;
@each $col in $cols {
> :nth-of-type(#{$i}) {
grid-column-start: nth($col,1);
grid-column-end: nth($col,2);
grid-row-start: nth($col,3);
grid-row-end: nth($col,4);
}
$i: $i + 1;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment