Answer the question
In order to leave comments, you need to log in
How to rebuild the tree in Media queries?
I type in Sass. There is such a structure. (For example)
.main
.content
.column
&.left
.messages
.message
padding-top: 150px
@media screen and (max-width: 767px)
.message
padding-top: 100px
Answer the question
In order to leave comments, you need to log in
If I understand you correctly, then SASS has nothing to do with it. Read up on CSS selector specificity (it's easy to google). As a last resort, you could use !important in your situation, but that's only if you understand why you're doing it and there's some sort of system for using it throughout the project.
But it would be wiser to use methodologies like the popular BEM or the not-so-popular RSCSS. This will be a much better solution than trying to hack one bad guy for another.
So much nesting of styles is not always a good thing. Try BEM. And about the weight of selectors, be sure to read
important - evil. Write the tree again.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question