Skip to content

Instantly share code, notes, and snippets.

@harnerdesigns
Created April 24, 2019 15:40
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 harnerdesigns/a9c6509d60ca66972be71cfd9c2d1ff6 to your computer and use it in GitHub Desktop.
Save harnerdesigns/a9c6509d60ca66972be71cfd9c2d1ff6 to your computer and use it in GitHub Desktop.
SASS Breakpoints Mixin
// Usage:
// @include breakpoint(desktop){ ... }
//
@mixin breakpoint($point) {
@if $point==desktop {
@media (min-width: 70em) {
@content ;
}
}
@else if $point==laptop {
@media (min-width: 64em) {
@content ;
}
}
@else if $point==tablet {
@media (min-width: 37.5em) {
@content ;
}
}
@else if $point==phablet {
@media (min-width: 37.5em) {
@content ;
}
}
@else if $point==mobileonly {
@media (max-width: 37.5em) {
@content ;
}
}
@else if $point==portrait {
@media (orientation: portrait) {
@content ;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment