Clean CSS-Files

Hey

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

Thank you Andy

6 comments
Comment actions Permalink

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

0
Comment actions Permalink

Also:

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

0
Comment actions Permalink

this is exactly what I was looking for
thank you

0
Comment actions Permalink

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 ... :)

0
Comment actions Permalink

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?

0
Comment actions Permalink

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.

0

Please sign in to leave a comment.