Last active
August 29, 2015 14:27
-
-
Save chrillewoodz/29288da90e401823866f to your computer and use it in GitHub Desktop.
Masonry grid system
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
| $breakpoints: (xs, sm, md, lg); | |
| $calculation: ''; | |
| @each $breakpoint in $breakpoints { | |
| @for $i from 1 through 12 { | |
| $calculation: 0% + ($i * 100 / 12); | |
| .masonry-#{$breakpoint}-#{$i} { | |
| @if $breakpoint == 'xs' { | |
| width: $calculation; | |
| } | |
| @else if $breakpoint == 'sm' { | |
| @media screen and (min-width: 768px) { | |
| width: $calculation; | |
| } | |
| } | |
| @else if $breakpoint == 'md' { | |
| @media screen and (min-width: 992px) { | |
| width: $calculation; | |
| } | |
| } | |
| @else if $breakpoint == 'lg' { | |
| @media screen and (min-width: 1200px) { | |
| width: $calculation; | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment