Created
April 27, 2019 05:41
-
-
Save jayontraps/9a05596576a90d6083910dde0d7036b9 to your computer and use it in GitHub Desktop.
sass mixin define columns
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 defineCols($numPerRow, $margin) { | |
width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); | |
&:nth-child(n) { | |
margin-bottom: $margin; | |
margin-right: $margin; | |
} | |
&:nth-child(#{$numPerRow}n) { | |
margin-right: 0; | |
margin-bottom: 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment