Search code examples
cssreplacecss-selectorsbackwards-compatibility

Detect and remove old browser CSS hacks from a stylesheet


So I’m in the middle of fiddling around with a site and I notice it’s full of old code and IE style resets/hacks/polyfills etc. all of which it’s not necessary to support anymore.

Rather than me trawling through thousands of lines of CSS, is there a simple, efficient and safe way to detect and remove old styles from a stylesheet?

I’m talking _background: gray; -ms-filter:; -WebKit-border-radius:; and all the other proprietary things from back in the day.

This site will support modern browsers only, using standard CSS3 selectors and attributes, so if I can find a way to parse and either automatically remove or at least give me line numbers for the antiquated code, that’d save me a huge amount of time (and save me having to start from scratch!!!)

Thanks in advance guys!


Solution

  • I found an incredibly useful tool: https://www.projectwallace.com/

    It doesn’t strip CSS, but gives a good overview!!!