Can PhpStorm / WebStorm remove unused css definitions in a css file?

Can PhpStorm / WebStorm remove unused css definitions in a css file? To actuallt remove them, not just identify them? I have tools which can identify them.

8 comments
Comment actions Permalink

Yes - using quickfix available from Inspections Results tool window:

Unused.png

1
Comment actions Permalink

Is this done for one css definition at a time? What if I have hundreds of unused definitions?

1
Comment actions Permalink

Select the 'Unused CSS selector' node in results and press the light bulb icon - quick fix will be applied to all files

fixAll.png

0
Comment actions Permalink

Why would the light bulb icon be disabled in my case? This is v11 EAP.

webstorm.png

1
Comment actions Permalink

No idea. May be, not all files unused selectors are found in are editable?

0
Comment actions Permalink

What do you mean not editable? Files which are read only? No it's not the case. Even if some files have some issue, the fix should be applied to the other files.

I should be getting some tootip help telling me what's going on and why I can't apply the global fix. Otherwise this is a bug.

1
Comment actions Permalink

Did anyone find the solution? I have the same problem. They can be removed 1 by 1 but when I try to do it over the whole file it says "There are no applicable quick fixes".

0

Please sign in to leave a comment.