Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (17 sloc) 765 Bytes


Very basic example of stripping media queries for old browsers (<IE9) using node.js fs

In search for a solution to this problem:

Test run

git clone the above files then:

node legacy-preprocessor.js

This should output a file legacy.css which you could include in your project using conditional comments:

<!--[if lt IE 9]><link rel="stylesheet" href="legacy.css"><![endif]-->

Potential expansions

  • Specify css file(s) or folder as a param
  • Rather than using the /*legacy*/ flag include param to specify a mq dimention as the selector
  • Update regex to capture entirety of the @media content rather than just one selector