-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Audit: CSS used selectors improvements #1456
Comments
@ebidel showing the unused rules was the original behavior but the consensus was that it was too overwhelming and so instead it just shows you the contents of the file (also helps in cases where there are many inline scripts in sites built with webpack). 0% rules used should show up but only if there's content and it has rules IMO :) will fix |
* filter out duplicate stylesheets * don't report stylesheets that have no rules addresses #1456
Yea, just trying to think what is most useful for developers to take action from. What I'm finding confusing now is that we're always showing general code snippets from the CSS file but that snippet won't contain the unused rule(s). That's a departure from other places in the report we only show violations. Guess I'm wondering how valuable the snippets are if they're not violations? For example, below I'm using all these rules (chromestatus.com): For the "100% usage entry"
|
* fix: less noisy CSS unused rules * filter out duplicate stylesheets * don't report stylesheets that have no rules addresses #1456 * add smokehouse length expectation * feedback
I think the snippets sole value is for identification of the stylesheet in cases where the URL is not sufficient and in all of these cases you've mentioned the URL is relatively self-explanatory and thus the snippet is just noise. I'm somewhat in favor of bringing back listing the unused selectors but truncating the output at some threshold (maybe just first 50 or something?), or maybe just showing the stylesheet snippet for inline stylesheets where there's no useful URL information? |
+1. Good balance of noise / usefulness ratio. I have the same problem with the deprecations audit. Some deprecations don't return url/line combos. I used "Unable to determine URL": |
fixed by #1496 |
Seeing this in the DBW tester:
What about listing the rules that are not used instead of file snippets? Also, should URLs that have "0% unused rules" show up in the list?
The text was updated successfully, but these errors were encountered: