Answer the question
In order to leave comments, you need to log in
What is the optimal placement for media queries?
How is it better? Group rule by elements
.component {
&__elem1 {
font-size: 12px;
@media (min-width: 992px) {
font-size: 15px;
}
}
&__elem2 {
font-size: 15px;
@media (min-width: 768px) {
font-size: 17px;
}
}
&__elem3 {
font-size: 10px;
}
&__elem4 {
font-size: 9px;
@media (min-width: 768px) {
font-size: 10px;
}
}
&__elem5 {
font-size: 18px;
@media (min-width: 992px) {
font-size: 10px;
}
}
}
.component {
&__elem1 {
font-size: 12px;
}
&__elem2 {
font-size: 15px;
}
&__elem3 {
font-size: 10px;
}
&__elem4 {
font-size: 9px;
}
&__elem5 {
font-size: 18px;
}
@media (min-width: 768px) {
&__elem2 {
font-size: 17px;
}
&__elem4 {
font-size: 10px;
}
}
@media (min-width: 992px) {
&__elem1 {
font-size: 15px;
}
&__elem5 {
font-size: 10px;
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question