Skip to content

Instantly share code, notes, and snippets.

@spktklr
Created September 29, 2016 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spktklr/41eee72948dc95dedc71643bd74e12b1 to your computer and use it in GitHub Desktop.
Save spktklr/41eee72948dc95dedc71643bd74e12b1 to your computer and use it in GitHub Desktop.
A responsive-property mixin for Sass Bootstrap
$grid-breakpoints: (
xs: 0,
sm: 544px,
md: 768px,
lg: 992px,
xl: 1200px,
xxl: 1920px
);
@mixin responsive-property( $rule, $sizes... ) {
@each $size in $sizes {
$i: index( $sizes, $size );
@if $size == nth( $sizes, 1 ) {
#{$rule}: $size;
} @else {
@include media-breakpoint-up( nth( map-keys( $grid-breakpoints ), $i ) ) { #{$rule}: $size; };
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment