Web Essentials: Remove unused CSS
Why Stack Overflow recommends it
Stack Overflow users link it as the reference walkthrough for using Web Essentials to detect unused CSS in Visual Studio, including when the feature seems not to work.
Recommended by 0 people across 0 different months, 2014 to 2018.
What it is
A short 2013 demo by Mads Kristensen, creator of the Web Essentials extension for Visual Studio, showing how to find and remove unused CSS in a web project. It walks through the tool's feature for flagging dead selectors.
What people said
Cites Josef · 2014-02 · Stack Overflow · on “Web essentials 2013 unused CSS”
Following this guide [this video] , I am removing unused CSS with Web essentials. Great feature overall, but I wonder if there are some settings that I am missing or if the tool aren't just not good enough. It highlights obviously used styles as unused. Do I need to teak the tool somehow? Or is the tool not smart enough to catch selectors like these: .hero h1 { }
Cites Roger Far · 2014-03 · Stack Overflow · on “Web Essentials 2013 unused css is not working”
Run the project and make sure Browser Link is enabled. While running there is an icon on your toolbar with a round going arrow. Click the downarrow next to it and click "Start Recording (all browsers)". Keep an eye on your Error List window where it should start showing the unused CSS. When click through your website the list should decrease as it ticks off the CSS it encounters. Make sure that you go through all the paths of your website otherwise some CSS might be marked as unused while it actually is (jQuery addClass for example). Source: [this video]
Cites Halil E. · 2018-01 · Stack Overflow · on “How can I remove Un-used CSS, Images & JS codes in Sublime Text 3”
May be its late for this answer but, i have the same thinking an i can just tell you to few options. There is NodeJS powered libraries doing the cleaning unused css selectors. Some of them really smart even if you used merged class name parts in javascript. You can find those just by google it like "remove unused css" And, i find the few videos on youtube about same topic. One of them using Visual Studio for this job but i dont tried this. Link here: [this video] Another option is Chrome Dev Tool. Just use chrome developer tools audits tab. Sorry for little confusing text but i have only those. I hope it will fix your problem or satisfy expectations.