Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Respond-to
=respond-to($val, $query: min-width, $media: screen)
@media #{$media} and ($query: $val)
@content
// ----- Sample Usage ----- //
p
+respond-to(700px)
width: 700px
+respond-to(500px, max-width)
width: 500px
+respond-to(800px, max-width, print)
width: 800px
/* ----- Sample Compile ----- */
@media screen and (min-width: 700px) {
p {
width: 700px;
}
}
@media screen and (max-width: 500px) {
p {
width: 500px;
}
}
@media print and (max-width: 800px) {
p {
width: 800px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment