Are there any tools that will scan a website and indicate what CSS isn't used?

Hi,

I’m wondering if there are any tools that would scan a website and find any duplicate or unused CSS?

Thanks!

1 Like

Oddly enough, I’ve just come across this link:

I haven’t tried it yet (I much prefer Firefox), but at first glance it looks useful.

An interesting question @toolman I often change css on my website and forget to remove old styles and then forget which I am or am not using.

That is strange as it was supposed to be in version 59 and I have 75 but no coverage tab.

I wish people would date pages like this and tutorial ones so you could tell how old there are.

1 Like

That’s doubly strange, because I found the link on Google’s PageSpeed Insights. rolleyes

I’ve had another look at this (in Chromium, not Chrome) and over on the far right side of the dev tools window there are three vertical dots which open a menu:

Chromium-menu

Choosing “Show console drawer” from that menu opens the view with the “Coverage” tab.

As far as I can tell from a quick test, it only indicates which CSS is not used on a particular page, so rules which are only applied on certain pages will show as “unused” on other pages. There doesn’t seem to be an easy way to scan an entire site.

2 Likes

I recall installing a plug-in for Firefox a while ago that does this. Now I look on my old laptop, it was Dust-Me Selectors.

I seem to recall this kind of issue with Dust-Me. Some selectors may be unused on a page which get flagged, but they are not necessarily unused in the entire site, so are not redundant.

1 Like

I now seem to remember this problem with a plugin I tried a few years ago.

I used Dust-Me Selectors, but it was incompatible with the new add-on method Firefox introduced a while back and I had to uninstall it, hence I didn’t mention it.

I think that to scan an entire site for unused CSS is likely to be a premium service, although I wonder if even these services will detect selectors added by JavaScript.

1 Like


Says it scans entire site, makes recommendations
for free.
However doesn’t seem to scan every page, so you’d have to be careful. For example, it went down one sub-menu option then when it got to the end of that, didn’t return to do the other branches, and didn’t do the entire main menu either.

1 Like

Nice, that seems to work very well! Thanks!

Hmm. It didn’t scan all pages on my site.

Thanks @TechnoBear for this brilliant explanation on this topic.

1 Like