Open jfbrennan opened 2 months ago
That feels like a very legit use case that I've run into myself as well.
Based on the current implementation we'd need some work to make it happen but it's definitely possible.
@bartveneman if you can send me to a good starting point I'm willing to help
First we need changes in https://github.com/projectwallace/css-analyzer, because currently is calculates the size of rules by looking how many children it has. I haven't decided yet how I'd want to reflect counting custom properties yet, either via an extra metric or maybe something else. After that we need to update this library with the latest analyzer version, update the corresponding rule(s).
Another option is to remove this rule entirely: we have another rule to check for a low enough average, so maybe we should leave it at that?
All these rules are highly arbitrary anyway and this one is always biting me too, so why not just drop it?
Excellent tool btw. Thanks for creating this!
The only red I got was one "Avoid many Declarations in single RuleSet". It's because of a large block of Custom Properties set on
:root
:This common and correct, especially in global stylesheets like design systems. Naming conventions and comments in the source code make it more maintainable.
Can the tool be made to understand large blocks of Custom Properties set on root? Can it then make an exception for this case and not flag it under "Avoid many Declarations in single RuleSet"?