Add max-selectors
What is the problem you're trying to solve?
limit the number of selectors allowed per file e.g. IE ≤9 had a 4095 hard limit
see
- bless
- webhint
- reports in the wild
- https://stackoverflow.com/q/20828995/248058
- https://github.com/clean-css/clean-css/issues/916
What solution would you like to see?
error out if it reaches the limit
- Name:
max-selectorsormax-selectors-per-file - Primary option:
int - Secondary options: none
- Message: TBD
- Description: TBD
- Section: "Limit language features" -> "General / Sheet"
@Mouvedia Thanks for the proposal.
Umm... According to the guideline for built-in rules, I don't think the proposed rule is "generally useful; not tied to idiosyncratic patterns". 🤔
Without depending on specific environments like IE9, is there a case reasonable to add the new rule?
Without depending on specific environments like IE9, is there a case reasonable to add the new rule?
Chrome and Safari are also affected :
- 4096:
- 4096 to 65536: RuleSet.h
- 8192 limit:
I didn't check Firefox but I am sure they also have their own limits.
@Mouvedia Thanks for the suggestion. Considering this hasn't been requested before I think we can assume it's not a limitation that the majority of our users have bumped into. However, we can leave the issue open to see if it garners any thumbs up. In the meantime, you can write a plugin. It'll be easy to port the plugin to be a built-in rule later down the line if necessary.