Skip to content

Instantly share code, notes, and snippets.

@justinryder
Created February 27, 2018 15:49
Show Gist options
  • Save justinryder/cd01a67a4d4b3781867239e4687ac30d to your computer and use it in GitHub Desktop.
Save justinryder/cd01a67a4d4b3781867239e4687ac30d to your computer and use it in GitHub Desktop.
You can nest media queries in SASS!
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
.foo {
content: 'no media query';
@media screen and (min-width: 640px) {
content: 'min-width: 640px';
@media (max-width: 1024px) {
content: 'min-width: 640px and max-width: 1024px';
}
}
@media screen and (min-width: 1024px) {
content: 'max-width: 1024px';
}
}
.foo {
content: 'no media query';
}
@media screen and (min-width: 640px) {
.foo {
content: 'min-width: 640px';
}
}
@media screen and (min-width: 640px) and (max-width: 1024px) {
.foo {
content: 'min-width: 640px and max-width: 1024px';
}
}
@media screen and (min-width: 1024px) {
.foo {
content: 'max-width: 1024px';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment