css-analyzer
css-analyzer copied to clipboard
Calculate total css complexity
We already support complexity for selectors, but could extend this to add value, property, declaration and atrule complexities. This could also clear the way for having a 'total complexity' for the whole stylesheet.
This would be awesome to graph out as well on projectwallace.com/analyze-css.
Some notes about edge cases and possible scenarios: https://astexplorer.net/#/gist/2d7b3b49ebc7094c0d0b7f29c023b757/ccf6dda1764a26a39098a90842a485916ce3fd4d
Checklist
- [x] Selectors
- [x] Vendor prefixes
- [x] Declarations (basically whether
!importantis used or not) - [x] Values
- [x] Vendor prefixes
- [x] Browserhacks
- [x] Properties
- [x] Vendor prefixes
- [x] Browserhacks
- [x] Custom properties with and without default values
- [x]
@media- [x] Browserhacks
- [ ]
@import- [ ] media queries
- [ ] layers
- [ ] supports-queries
- [ ]
@supports- [ ] Complexity of 'declaration'
- [ ] Vendor prefixes
- [x] browser hacks
- [ ]
@container- [ ] Complexity of 'declaration'
- [x]
@keyframes(whether it's vendor prefixed)