Created
September 29, 2016 14:22
-
-
Save spktklr/41eee72948dc95dedc71643bd74e12b1 to your computer and use it in GitHub Desktop.
A responsive-property mixin for Sass Bootstrap
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
$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