Created
September 21, 2016 16:25
-
-
Save jmlweb/413b765f0ef3c15a3f840759d43fc419 to your computer and use it in GitHub Desktop.
BEMIT Responsive Suffixes Column Mixins
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 generate-column($width: 1, $suffix: null) { | |
$gutter: ($width - 1) * $size-gutter; | |
$width-mod: null; | |
@if ($width != 1) { | |
$width-mod: --#{$width}; | |
} | |
@if ($suffix != null) { | |
$suffix: \@#{$suffix}; | |
} | |
.l-column#{$width-mod}#{$suffix} { | |
float: left; | |
width: calc( (100% - #{$gutter}) / #{$width}); | |
} | |
} | |
@mixin column($width: null) { | |
@include generate-column($width); | |
$sizes: ( | |
'xs': $size-xs, | |
'sm': $size-sm, | |
'md': $size-md, | |
'lg': $size-lg, | |
'xl': $size-xl | |
); | |
@each $size in $sizes { | |
@media(min-width: nth($size, 2)) { | |
@include generate-column($width, nth($size, 1)); | |
} | |
} | |
} | |
@for $i from 1 through 12 { | |
@include column($i); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment