Last active
December 21, 2018 21:01
-
-
Save helloncanella/8d253364a1c7e8c09afa364946b2dd6a 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 grid($columns, $gutter){ | |
| display: flex; | |
| flex-wrap: wrap; | |
| $r: $columns; | |
| $s: $gutter; | |
| $f: calc(#{100%/$r} - #{(($r - 1)*$s)/$r}); | |
| &>*{ | |
| width: $f; | |
| margin-bottom: $s; | |
| &:not(:nth-child(#{$r}n)){ | |
| margin-right: $s; | |
| } | |
| } | |
| //cancelling the margin-bottom of the last row | |
| & + * { | |
| margin-top: - $s; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment