Skip to content

Instantly share code, notes, and snippets.

@nickautomatic
Created March 10, 2015 16:19
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 nickautomatic/87c78106f04e4e156932 to your computer and use it in GitHub Desktop.
Save nickautomatic/87c78106f04e4e156932 to your computer and use it in GitHub Desktop.
Super-simple breakpoint mixin
// Super simple mobile-first breakpoint mixin:
@mixin breakpoint($from) {
@media screen and (min-width: $from) { @content; }
}
// Example usage:
$small: 480px;
nav {
@include breakpoint($small) {
display: none;
}
}
// ...alternative usage (for, eg. one-off tweakpoints):
// cf. https://adactio.com/journal/6044
nav {
@include breakpoint(480px) {
display: none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment