Clean CSS-Files


Is there a possibility of a check to css file?
So all is no longer used items are listed?

Thank you Andy


Hi Andy,

You can try this (although I do not guarantee that this will work perfectly).

1. (recommended) Settings | Inspections -- create new profile, deselect all except "CSS | Unused CSS selector" (this is to speed up the process by reducing number of unnecessary in your case checks)
2. Go back to editor and use "Code | Inspect Code" -- choose profile created in step #1 (if you did it) or use Project Default
3. Check results



Code | Run inspection by name | type "Unused CSS" | select scope | browse result


this is exactly what I was looking for
thank you


When I tried that in CSS file this action was unavailable (inactive) for me for some reason -- even switching between tabs did not helped -- as soon as I come back to that CSS file it become inactive again.

But I've tried it again (PhpStorm was restarted since then).. and this time it worked fine ?:| ...

I should try harder next time ... :)


No problem. Your advices are always quite correct and practical. And always highly appreciated.

As for this particular action - perhaps the indexing was in progress?


No - nothing like that: it's a tiny testing project with maybe 30 files in total; no external libraries; project was opened for quite some time and no external changes to those files.

Possibly one of those "Windows (tm) moments" that can effect any running program. Nothing important -- happened only once here so far.


Please sign in to leave a comment.