Skip to content

Instantly share code, notes, and snippets.

@eddiesigner
Created May 14, 2017 14:24
Show Gist options
  • Save eddiesigner/d6acd4021f7dc5b5c0c2a05e5f57a230 to your computer and use it in GitHub Desktop.
Save eddiesigner/d6acd4021f7dc5b5c0c2a05e5f57a230 to your computer and use it in GitHub Desktop.
Gulp Simple Media Queries Example
var gulp = require('gulp');
var postcss = require('gulp-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 plugin
gulp.task('css', function () {
var processors = [ // The order is important because this plugin depends on nesting capabilities
simple_media_queries,
postcss_nested
];
return gulp.src('./src/*.css') // Your source stylesheets
.pipe(postcss(processors)) // Processes the styles through the plugin
.pipe(gulp.dest('./dest')); // Get a compiled stylesheets
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment