Skip to content

Instantly share code, notes, and snippets.

@garystorey
Created August 4, 2014 18:05
Show Gist options
  • Save garystorey/3f7ea6e1010c62f083c4 to your computer and use it in GitHub Desktop.
Save garystorey/3f7ea6e1010c62f083c4 to your computer and use it in GitHub Desktop.
Get critical styles via Gulp
var penthouse = require('penthouse');
var Promise = require("bluebird");
var penthouseAsync = Promise.promisify(penthouse);
gulp.task('critical', function(){
penthouseAsync({
url : 'http://daverupert.com/',
css : './stylesheets/style.css',
height: 480
}).then( function (criticalCSS){
require('fs').writeFile('_includes/critical.css', criticalCSS );
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment