Stylelint in my experience is almost all, if not all, about enforcing stylistic convention. I can't stand it because I do not find most of the stylistic conventions enforced to actually improve legibility.
Stylelint in my experience is almost all, if not all, about enforcing stylistic convention. I can't stand it because I do not find most of the stylistic conventions enforced to actually improve legibility.
This requires in my experience using a consistent bem syntax otherwise specificity snowballs pretty fast.
Using an id is not inherently wrong, and with stylelint you can always disable a rule for the exceptions, with a comment of the form /* stylelint-disable-next-line <optional specific rule id> */
Nowadays esp. with composition methodology it’s almost always better to just use a unique bem like class, eg. .HomepageHero-carousel , even if the element in question is a "singleton"... because later someone can stick a mb-4 on it, or a text-lg , or even your own custom utility or modifier and it will stick, without snowballing css selector complexity.
Applying styles can be done via classes so the css selectors in your stylesheets do not need to mention any #ids.
Applying styles with #ids however, is an issue.
[1] https://stylelint.io/user-guide/rules/no-descending-specific...
But I guess deploying a footgun is often a minimum two person job:
first person writes code that when used wrong will shoot in foot but they would never use wrong, next person actually pulls the trigger.