Answer the question
In order to leave comments, you need to log in
How do you write media queries in sass?
Good afternoon
Which use case of media queries would be more correct:
.selector {
@media (width1) {}
@media (width2) {}
}
.selector {
}
@media (width1) {.selector {}}
@media (width2) {.selector {}}
Answer the question
In order to leave comments, you need to log in
The second one is correct.
And the first one is convenient, but then you need to run it through gulp-combine-mq .
Also don't forget about breakpoint-sass.com
I prefer to write directly in the selector, you can immediately see how the element is being modified, and write less.
IMHO, this option looks much more readable, especially when there are a lot of styles -
@media (max-width: 1) {
.selector1{
///стили
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question