Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eddiesigner/cd2d404a40dcfb3703f5a905c819f942 to your computer and use it in GitHub Desktop.
Save eddiesigner/cd2d404a40dcfb3703f5a905c819f942 to your computer and use it in GitHub Desktop.
PostCSS Simple Media Queries Example
var fs = require('fs');
var postcss = require('postcss'); // Load PostCSS
var postcss_nested = require('postcss-nested'); // Load the postcss-nested plugin
var simple_media_queries = require('postcss-simple-media-queries'); // Load the postcss-simple-media-queries
var css = fs.readFileSync('input.css', 'utf8'); // Your stylesheet
var output = postcss([simple_media_queries, postcss_nested]) // The order is important because this plugin depends on nesting capabilities
.process(css)
.css;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment