Merge pull request #219 from google/uncss_filter

Adding ignore filters to uncss so that the slide out menu works
This commit is contained in:
Addy Osmani 2014-06-30 17:47:00 +01:00
commit c9ae83a019

View File

@ -95,6 +95,10 @@ gulp.task('styles', ['styles:components', 'styles:scss', 'styles:css']);
// Scan Your HTML For Assets & Optimize Them
gulp.task('html', function () {
// CSS Selectors for UnCSS to ignore
var ignore_css_selectors = [".navdrawer-container.open", /.app-bar.open/];
return gulp.src('app/**/*.html')
.pipe($.useref.assets({searchPath: '{.tmp,app}'}))
// Concatenate And Minify JavaScript
@ -104,7 +108,7 @@ gulp.task('html', function () {
// Remove Any Unused CSS
// Note: If not using the Style Guide, you can delete it from
// the next line to only include styles your project uses.
.pipe($.if('*.css', $.uncss({ html: ['app/index.html','app/styleguide/index.html'] })))
.pipe($.if('*.css', $.uncss({ html: ['app/index.html','app/styleguide/index.html'], ignore: ignore_css_selectors })))
.pipe($.useref.restore())
.pipe($.useref())
// Update Production Style Guide Paths