Skip to content

Instantly share code, notes, and snippets.

@raspo
Created June 13, 2013 21:29
Show Gist options
  • Save raspo/5777533 to your computer and use it in GitHub Desktop.
Save raspo/5777533 to your computer and use it in GitHub Desktop.
Easy media queries in sass
@mixin respond-to($media) {
@if $media == small {
@media only screen and (max-width: 420px) { @content }
}
@else if $media == medium {
@media only screen and (max-width: 768px) { @content }
}
@else if $media == large {
@media only screen and (max-width: 980px) { @content }
}
}
.some{
margin-top: 20px;
@include respond-to(small){
margin-top: 10px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment