Skip to content

Instantly share code, notes, and snippets.

@xahy
Created December 26, 2016 04:00
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 xahy/18fbc6708f85fcc4b7acc473d6c44544 to your computer and use it in GitHub Desktop.
Save xahy/18fbc6708f85fcc4b7acc473d6c44544 to your computer and use it in GitHub Desktop.
A mixin to add media query related style attributes
@mixin breakpoint($point) {
@if $point == large {
@media (min-width: 1250px) { @content; }
}
@else if $point == medium {
@media (min-width: 650px) { @content; }
}
@else if $point == small {
@media (max-width: 650px) { @content; }
}
}
@xahy
Copy link
Author

xahy commented Apr 19, 2017

Usage:

.some-class {
   @include breakpoint(medium) {
      \\content
   }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment