Created
May 7, 2014 19:20
-
-
Save rjfranco/9b2e9deebd0be922f828 to your computer and use it in GitHub Desktop.
Object Oriented Media Queries with Sass
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 == small { | |
| @media only screen and (max-width: 1024px) { | |
| @content; | |
| } | |
| } | |
| @if $media == tablet { | |
| // @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) { | |
| // @content; | |
| // } | |
| @media only screen and (min-width: 768px) and (max-width: 959px) { | |
| @content; | |
| } | |
| } | |
| @else if $media == mobile { | |
| @media only screen and (max-width: 767px) { | |
| @content; | |
| } | |
| } | |
| } |
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
| import 'mixin'; | |
| img.image-type { | |
| position: absolute; | |
| width: 24px; | |
| height: 24px; | |
| right: 15px; | |
| top: 15px; | |
| @include respond-to(mobile) { | |
| top: 10px; | |
| right: 10px; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment