Skip to content

Instantly share code, notes, and snippets.

@w33ble
Last active December 12, 2015 08:08
Show Gist options
  • Save w33ble/4741904 to your computer and use it in GitHub Desktop.
Save w33ble/4741904 to your computer and use it in GitHub Desktop.
Responsive with Stylus
#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;
}
}
// 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