Created
June 22, 2014 01:48
-
-
Save soderalohastrom/d480d15ef8b807494aa6 to your computer and use it in GitHub Desktop.
Slightly changed rowMachine
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
* { | |
box-sizing: border-box; | |
} | |
body { | |
background: #222; | |
} | |
@mixin rowMachine($numPerRow, $margin) { | |
width: ((100% - (($numPerRow - 1) * $margin)) / $numPerRow); | |
&:nth-child(n) { | |
margin-right: $margin; | |
} | |
&:nth-child(#{$numPerRow}n) { | |
margin-right: 0; | |
} | |
&:nth-child(#{$numPerRow}n+1) { | |
clear: left; | |
} | |
} | |
.person { | |
background: white; | |
padding: 10px; | |
margin-bottom: 20px; | |
float: left; | |
@media (min-width: 1200px) { | |
@include rowMachine(4, 2%); | |
} | |
@media (min-width: 900px) and (max-width: 1200px) { | |
@include rowMachine(4, 2%); | |
} | |
@media (max-width: 900px) { | |
@include rowMachine(3, 4%); | |
} | |
img { | |
max-width: 100%; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment