Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 8/Sass: Find unused css classes

Tags:

sass

angular

I have an Angular project that uses Angular+Sass, and since the project became pretty big I am constantly finding unused small css classes that need to be removed. I am trying to find a way to remove them all, but for now nothing helped me.

I tried purifycss that didn't give me any output or error, ngx-unused-css that I cannot make it work since it has a framework error (path must be string not undefined), and I feel like I am out of options, and the coverage of Chrome that doesn't display any css files in it, and external sites are not an option since they won't have access to the deployed project location.

Is there some kind of tool or option that I can use to find all unused classes in Angular/Sass?

like image 775
Artyomska Avatar asked Nov 15 '19 13:11

Artyomska


1 Answers

There are a lot of IDE plugins for that.

On my case I use https://marketplace.visualstudio.com/items?itemName=rcore.rcore-unused-css-classes from Visual Studio Code Extensions

like image 175
Pedro Bezanilla Avatar answered Nov 02 '22 08:11

Pedro Bezanilla