I'm using stylelint with the standard format stylelint-config-standard
and I'm encountering this error a lot with my stylesheets:
no-descending-specificity
An example of where it's happening is when I have CSS like:
.footer__social li a {}
.footer__social li a:hover {}
.footer__links li a {}
.footer__links li a:hover {}
and then I get the following error:
Expected selector ".footer__links li a" to come before selector ".footer__social li a:hover" no-descending-specificity
.
A lot of the CSS will be like this because of using SASS like:
.footer__links {
a {
a:hover {}
}
}
I don't want to have disable this if I can...
But why is it complaining? as it's two separate classes: .footer__social
and .footer__links
.
So these two declarations for the anchors don't have any effect on each other because they have different parent classes so what's the issue? I'd understand something like:
.footer__links a:hover {}
a {}
But I don't see the issue if it's two different classes...