Last active
December 12, 2015 08:08
-
-
Save w33ble/4741904 to your computer and use it in GitHub Desktop.
Responsive with Stylus
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
#thing1 { | |
display: inherit; | |
background-color: #f00; | |
} | |
@media (max-width: 767px) { | |
#thing1 { | |
display: none !important; | |
} | |
} | |
#thing2 { | |
display: none; | |
background-color: #00f; | |
} | |
@media (min-width: 768px) and (max-width: 979px) { | |
#thing2 { | |
display: inherit !important; | |
} | |
} |
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
// Device media queries | |
tablet = "(min-width: 768px) and (max-width: 979px)" | |
phone = "(max-width: 767px)" | |
// Useful mixins | |
hideOn(device) | |
display: inherit // bug in stylus, we need a core rule | |
@media device | |
display: none !important | |
showOn(device) | |
display: none | |
@media device | |
display: inherit !important | |
#thing1 | |
hideOn('phone') | |
background-color: red | |
#thing2 | |
showOn('tablet') | |
background-color: blue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment