Join GitHub today
Stylelint: Add no-descending-specificity and fix offenders #1119
From the stylelint docs:
The clashes of these two mechanisms for prioritization, source order and specificity, can cause some confusion when reading stylesheets. If a selector with higher specificity comes before the selector it overrides, we have to think harder to understand it, because it violates the source order expectation. "
Stylelint (which can be run by using
Note: there are currently lots of offenders for this rule, so it may be worth waiting until master.less is more manageable (#1092) before attempting this
I'm seeing lots of errors when I add this rule.
Let's keep the first pull request small and reasonably safe from merge conflicts! As a general rule, I'd recommend disabling the rule at the top of large files which have more than 6 errors . (e.g. static/css/components/header-bar.less and static/css/legacy.less) and focusing on the files which have less problems.
The goal with this linting is to slowly chip away at the CSS and improve it so don't take too much on at a time - focus on the files with 1-6 issues! Otherwise, it will make it harder for you to write and others to review.
Does this make sense?
Let me know if any more guidance needed!
 Adding the following line at the top of the file will stop the rule from applying there!