While I am glad that he is taking a second to question what we do in order that we might do things better, I think he lacks a simple understanding of specificity. The reason that it is good to avoid nesting at all cost is because the more you nest things, the higher specificity you are creating. The higher specificity you create:
Your code becomes more bloated
It’s harder to target elements thus leading some to use the !important declaration (Bad!! Bad!! Bad!!)
This is not easily scalable.
Jono Herrington
10y agoWhile I am glad that he is taking a second to question what we do in order that we might do things better, I think he lacks a simple understanding of specificity. The reason that it is good to avoid nesting at all cost is because the more you nest things, the higher specificity you are creating. The higher specificity you create:
Your code becomes more bloated
It’s harder to target elements thus leading some to use the !important declaration (Bad!! Bad!! Bad!!)
This is not easily scalable.