Skip to content

Instantly share code, notes, and snippets.

@marcelosomers
Created September 28, 2014 18:28
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 marcelosomers/d395bd3d7bab555524c5 to your computer and use it in GitHub Desktop.
Save marcelosomers/d395bd3d7bab555524c5 to your computer and use it in GitHub Desktop.
Responsive Breakpoint Handler
/**
* Responsive breakpoint, to be used as @include breakpoint(name) {}
*/
@mixin breakpoint($name) {
@if map-has-key($breakpoints, $name) { // 1
@media #{inspect(map-get($breakpoints, $name))} { // 2
@content;
}
}
@else { // 3
@warn "Couldn't find a breakpoint named `#{$name}`."; // 4
}
}
/**
* Define the breakpoints as a Sass list
*/
$breakpoints: (
'fluid': ( max-width: 751px ),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment