Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Removing media queries for non-supporting legacy browsers using node.js
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.md
legacy-preprocessor.js
style.css

README.md

legacy-preprocessor

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

In search for a solution to this problem: http://simurai.com/post/30451824480/media-query-splitting

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
Something went wrong with that request. Please try again.