Created
July 20, 2018 10:40
-
-
Save claudia-romano/83f6f4911d7cb87539860447f935a4c2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 gridAdvanced($cols...) { | |
| $i: 1; | |
| $span: 0; | |
| @each $col in $cols { | |
| > :nth-of-type(#{$i}) { | |
| @if nth($col,2) == -1 { | |
| $span: $grid-columns - nth($col,2) - nth($col,1); | |
| } @else { | |
| $span: nth($col,2) - nth($col,1); | |
| } | |
| width: calc( #{$span}*((100% - #{$gap-horizontal}*#{$grid-columns})/#{$grid-columns}) + (#{nth($col,1)} - 1)*#{$gap-horizontal} - 1px); | |
| min-width: 0px; | |
| } | |
| $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-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; | |
| } | |
| > :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