Last active
August 29, 2016 09:53
-
-
Save 4lun/0ad68c70e83a4e075898 to your computer and use it in GitHub Desktop.
Basic BEM CSS Grid
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
$breakpoint-lrg: 780px; | |
$breakpoint-med: 450px; | |
$grid-gutter: 15px; | |
.grid { | |
@extend %clearfix; | |
margin-left: -($grid-gutter); | |
&__col { | |
float: left; | |
padding-left: $grid-gutter; | |
min-height: 1px; | |
width: 100%; | |
@for $i from 1 through 12 { | |
&--sml-#{$i} { | |
width: (100%/12)*$i; | |
} | |
} | |
@media (min-width: $breakpoint-med) { | |
@for $i from 1 through 12 { | |
&--med-#{$i} { | |
width: (100%/12)*$i; | |
} | |
} | |
} | |
@media (min-width: $breakpoint-lrg) { | |
@for $i from 1 through 12 { | |
&--lrg-#{$i} { | |
width: (100%/12)*$i; | |
} | |
} | |
} | |
&--right { | |
float: right; | |
} | |
} | |
} |
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
%clearfix { | |
&:before, | |
&:after { | |
content: " "; | |
display: table; | |
} | |
&:after { | |
clear: both; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment