Created
May 13, 2014 18:53
-
-
Save dallasbpeters/0eca77dbcf550755c177 to your computer and use it in GitHub Desktop.
A Sass mixin for media queries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin respond-to($media) { | |
@if $media == handhelds { | |
@media only screen and (max-width: 479px) { @content; } | |
} | |
@else if $media == wide-handhelds { | |
@media only screen and (min-width: 480px) and (max-width: 767px) { @content; } | |
} | |
@else if $media == tablets { | |
@media only screen and (min-width: 768px) and (max-width: 959px) { @content; } | |
} | |
} | |
#element { | |
@include respond-to(handhelds) { float: none; } | |
@include respond-to(wide-handhelds) { float: none; } | |
@include respond-to(tablets) { width: 240px; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
credits to Mike Fowler