Last active
January 20, 2018 13:53
-
-
Save vitaliy-kravchenko-dev/98a757d8330e534e6c01674ecea391c4 to your computer and use it in GitHub Desktop.
Flex grid mixin
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 flex-grid-items($cols) { | |
display: flex; | |
flex-wrap: wrap; | |
> * { | |
$item-width: 100% / $cols; | |
width: $item-width; | |
box-sizing: border-box; | |
} | |
} | |
///////////////////////////////////////// | |
.flex-2-cols { | |
@include flex-grid-items(2) | |
} | |
.flex-5-cols { | |
@include flex-grid-items(5) | |
} | |
.flex-9-cols { | |
@include flex-grid-items(9) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment