Skip to content

Instantly share code, notes, and snippets.

@jmlweb
Created September 21, 2016 16:25
Show Gist options
  • Save jmlweb/413b765f0ef3c15a3f840759d43fc419 to your computer and use it in GitHub Desktop.
Save jmlweb/413b765f0ef3c15a3f840759d43fc419 to your computer and use it in GitHub Desktop.
BEMIT Responsive Suffixes Column Mixins
@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