How to find unused CSS from rails? deadweight not working [closed]
As the title says, I want to 'purify' the CSS of my rdails application, to find unused CSS selectors.
I found a gem called deadweight, but is too old. I can't event install it today (Dependencies failing)
So, is there another or actual way to clean the CSS? or an alternative to deadweight?
Thanks a lot!
To actually find whether your CSS selector exists or not, your tool would need to render all your templates and keep executing random js events until given selector shows off - and it will need to be able to tell whether it is ever gona find it. This is a halting problem, proved to be computable impossible to solve.
That being said, you can always use tools like the one listed on other answers - they might give you a list of suspicious selectors, however you will need to spend significant amount of time with every single one of them to find if there is a single case in your application when it can actually be used.
Word of warning:
DustMe crawl the website through all the links on your page to get a better view of whole website - you don't use
link_to ..., method: <post|delete|put>, do you?