Skip to content

Instantly share code, notes, and snippets.

@FutureMedia
Forked from timknight/breakpoint-v2.scss
Last active August 29, 2015 14:07
Show Gist options
  • Save FutureMedia/ea574823e0c33c1924e8 to your computer and use it in GitHub Desktop.
Save FutureMedia/ea574823e0c33c1924e8 to your computer and use it in GitHub Desktop.
$xs: ( max: 767px );
$sm: ( min: 768px );
$md: ( min: 992px );
$lg: ( min: 1200px );
$sm-only: ( min: map-get($sm, min), max: map-get($md, min) - 1 );
$md-only: ( min: map-get($md, min), max: map-get($lg, min) - 1 );
@mixin breakpoint($map) {
$query: "";
@if map-has-key($map, min) { $query: append($query, "(min-width: #{map-get($map, min)})") }
@if map-has-key($map, min) and map-has-key($map, max) { $query: append($query, "and") }
@if map-has-key($map, max) { $query: append($query, "(max-width: #{map-get($map, max)})") }
@media screen and #{$query} { @content; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment