[Lint] Disable `no-descending-specificity` Stylelint rule
BenDMyers opened this issue · comments
We should disable the no-descending-specificity
Stylelint rule.
For instance, it's producing the following error with regards to the selector [data-twitch-sender-roles~='mod'] .twitch-chat-sender
:
120:1 ✖ Expected selector ".twitch-chat-sender" to come before selector "[data-twitch-sender-roles~='mod'] .twitch-chat-sender" no-descending-specificity
This is invalid, since the .twitch-chat-sender
node is a child of the [data-twitch-sender-roles]
node — reversing the order would create a selector that wouldn't apply to anything in the overlay.
I also vote to disable that rule.
The enforcing of descending specificity gets weird sometimes.
I saw @peruvianidol met this one as well.
It caught a condition where nightbot-styles would be overridden if it was a subscriber and a mod,
But it's not worth enforcing that all the time because:
- false positives do slip in sometimes
- the order sometimes does make sense, even if that rule complains (like in the peruvianidol theme)
The docs are here: https://stylelint.io/user-guide/rules/list/no-descending-specificity/
edit: if you search that file, does an other rule that ends in .twitch-chat-sender
show up? The rule wants you to put lower specificity rules above higher specificity rules in source-order. Not swap two parts of a rule, that's kinda confusing language in the error message.