Skip to content

Instantly share code, notes, and snippets.

@moxdev
Created August 10, 2016 19:34
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 moxdev/79f898792f260d9f93ad76a5d784b366 to your computer and use it in GitHub Desktop.
Save moxdev/79f898792f260d9f93ad76a5d784b366 to your computer and use it in GitHub Desktop.
Mobile first Sass mixin for common breakpoints
// iPhone, min-width: 320px
// mobile, min-width: 480px
// tablet, min-width: 768px
// laptop, min-width: 992px
// desktop, min-width: 1200px
@mixin respond-to($breakpoint) {
@if $breakpoint == "iphone" {
@media (min-width: 320px) {
@content;
}
}
@else if $breakpoint == "mobile" {
@media (min-width: 480px) {
@content;
}
}
@else if $breakpoint == "tablet" {
@media (min-width: 768px) {
@content;
}
}
@else if $breakpoint == "laptop" {
@media (min-width: 992px) {
@content;
}
}
@else if $breakpoint == "desktop" {
@media (min-width: 1200px) {
@content;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment