Created
February 13, 2012 22:11
-
-
Save jescalan/1820905 to your computer and use it in GitHub Desktop.
responsive
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
| =responsive($to) | |
| @if $to == phone | |
| @media only screen and (max-width: 479px) | |
| @content | |
| @else if $to == landscape | |
| @media only screen and (min-width: 480px) and (max-width: 767px) | |
| @content | |
| @else if $to == tablet | |
| @media only screen and (min-width: 768px) and (max-width: 959px) | |
| @content | |
| @else if type-of($to) == number | |
| @media only screen and (max-width: $to + px) | |
| @content | |
| @else if type-of($to) == list | |
| @media only screen and (min-width: nth($to, 1) + px) and (max-width: nth($to, 2) + px) | |
| @content | |
| @else | |
| @warn The mixin doesn't want what you're servin up. Check the documentation for usage details | |
| // Usage | |
| .header | |
| width: 200px | |
| float: left | |
| +responsive(phone) | |
| width: 100% | |
| color: blue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment