Created
November 19, 2014 16:03
-
-
Save dbox/4d04c1287931fc9e0076 to your computer and use it in GitHub Desktop.
// Freaking easy responsive rows of items by @chriscoyier
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
// Freaking easy responsive rows of items by @chriscoyier (http://css-tricks.com/video-screencasts/132-quick-useful-case-sass-math-mixins/) | |
@mixin rowMachine($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