Last active
August 29, 2015 14:11
-
-
Save juanbrujo/ff31e8f01c570845a246 to your computer and use it in GitHub Desktop.
micro-responsive CSS classes
This file contains 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
Single: | |
<div class="desktop-only">desktop-only</div> | |
<div class="tablet-only">tablet-only</div> | |
<div class="mobile-only">mobile-only</div> | |
Combined: | |
<div class="desktop-only tablet-only">.desktop-only.tablet-only</div> | |
<div class="tablet-only mobile-only">.tablet-only.mobile-only</div> |
This file contains 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
//mediaqueries breakpoints | |
@mobile: ~"only screen and (max-width: 529px)"; | |
@tablet: ~"only screen and (min-width: 530px) and (max-width: 949px)"; | |
@desktop: ~"only screen and (min-width: 950px)"; | |
.desktop-only.tablet-only { | |
display: block; | |
} | |
.tablet-only.mobile-only { | |
display: block; | |
} | |
//Desktop | |
@media @desktop { | |
.desktop-only { | |
display: block; | |
} | |
.tablet-only, | |
.mobile-only, | |
.tablet-only.mobile-only { | |
display: none; | |
} | |
} | |
//Tablet | |
@media @tablet { | |
.tablet-only { | |
display: block; | |
} | |
.desktop-only, | |
.mobile-only { | |
display: none; | |
} | |
} | |
//Mobile | |
@media @mobile { | |
.mobile-only { | |
display: block; | |
} | |
.desktop-only, | |
.tablet-only, | |
.desktop-only.tablet-only{ | |
display: none; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment