Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tool to find unused css selectors #225

Open
timurvafin opened this issue Oct 9, 2014 · 2 comments
Open

Tool to find unused css selectors #225

timurvafin opened this issue Oct 9, 2014 · 2 comments

Comments

@timurvafin
Copy link
Member

Deadweight

Deadweight is used for cleaning unused CSS selectors. You have to hand out a set of your application's style sheets and HTML pages, and it will report which CSS selectors are safe to remove.

The gem won’t work out of the box in Rails, since most pages have dynamic content, but Jason Morrison from Thoughtbot wrote a blog post on how to create a Rack Middleware and integrate it into your test suite to collect all the HTML content in one place.

If you're using precompilers such as Sass or Less, you should compile all of your style sheets and hand them out as simple CSS files to the deadweight task. It is recommended that you remove all the vendor/third-party css files (such as Bootstrap files and similar) since they will end up clogging your output.

@ArturMinnullin
Copy link
Contributor

@timurvafin Does this issue still stand? If so, I can prepare PR.

@timurvafin
Copy link
Member Author

@ArturMinnullin yes, please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants