Created
April 9, 2015 19:04
-
-
Save johannesjo/ab9518afd3351e57653b to your computer and use it in GitHub Desktop.
A row machine mixin that uses css calc to ease your rowing
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 rowMachineCalc($numPerRow, $margin) { | |
@include clearfix(); | |
display: block; | |
> * { | |
width: calc(#{(100% / $numPerRow)} - #{(($numPerRow - 1) * $margin)/$numPerRow}); | |
float: left; | |
&:nth-child(n) { | |
margin-bottom: $margin; | |
margin-right: $margin; | |
} | |
&:nth-child(#{$numPerRow}n) { | |
margin-right: 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment