sseeeedd icon indicating copy to clipboard operation
sseeeedd copied to clipboard

Critical CSS

Open ffoodd opened this issue 5 years ago • 0 comments

Here is an oldish critical task:

/**
 * @section Build
 * Inline critical CSS
 */
 gulp.task('critical', ['build'], function () {
   return gulp.src(paths.dest + '*.html')
      .pipe(critical({
         base: paths.dest,
         inline: true,
         minify: true,
         css: paths.dest + 'css/styles.min.css'
      }))
      .on('error', function(err) {
         gutil.log(gutil.colors.red(err.message));
      })
      .pipe(gulp.dest(paths.dest));
});

There might be a better package or way out there, now.

ffoodd avatar Aug 14 '19 06:08 ffoodd