Using SASS, I can do this
.foo {
width: 100%;
@media (max-width: 1200px) {
width: 1000px;
}
}
Compiles to:
.foo {
width: 100%;
}
@media (max-width: 1200px) {
.foo {
width: 1000px;
}
}
Ok, but I also have this code compiled:
.bar {
padding: 10px 0;
}
@media (max-width: 1200px) {
.bar {
padding: 50px 0;
}
}
Note that the @media (max-width: 1200px)
are repeated and will be repeated throughout the code many times... So, how to gathers the equal media queries in the same place?
Like this:
.foo {
width: 100%;
}
@media (max-width: 1200px) {
.foo {
width: 1000px;
}
.bar {
padding: 50px 0;
}
}