Cssnano: Keyframes are missing after compiling

Created on 4 Feb 2017  路  2Comments  路  Source: cssnano/cssnano

@keyframes rippleria {
    0% {
        opacity: 0;
        @include transform(scale(2.5));
    }
    100% {
        opacity: 0;
        @include transform(scale(2.5));
    }
}

CSS Nano doesn't compile this to my minified css file. It's in my non minified version and works as expected.

This is what I have in my gulp file.

gulp.task('scss', function() {

    return gulp.src('src/scss/styles.scss')
        .pipe(plumber())
        .pipe(sourcemaps.init())
        .pipe(sassGlob())
        .pipe(sass({
            compass: false,
            includePaths: [
                'node_modules/susy/sass',
                'node_modules/breakpoint-sass/stylesheets',
                bower + 'sumoselect',
                bower + 'flickity/dist',
                require('node-bourbon').includePaths,
            ]
        }).on('error', sass.logError))
        .pipe(sourcemaps.init())
        //.pipe(prefix())
        .pipe(gulp.dest(cssDest))
        .pipe(cssnano({
            reduceIdents: false,
            discardComments: {
                removeAll: true
            }
        }))
        .pipe(rename('styles.min.css'))
        .pipe(sourcemaps.write('./maps'))
        .pipe(gulp.dest(cssDest))

        .pipe(reload({
            stream: true
        }));
});
documentation

Most helpful comment

Hi @xstortionist,

You'll need to set the discardUnused option:

{
  reduceIdents: false,
  discardComments: {
    removeAll: true
  },
  discardUnused: false
}

All 2 comments

Hi @xstortionist,

You'll need to set the discardUnused option:

{
  reduceIdents: false,
  discardComments: {
    removeAll: true
  },
  discardUnused: false
}

@ben-eb that did the trick. Been searching for hours, could not find the solution. Will update the rest of my projects now that I'm finally converting over to cssnano. Thanks again, good night sir.

Was this page helpful?
0 / 5 - 0 ratings