0.1.4 • Published 10 years ago

postcss-ignore v0.1.4

Weekly downloads
16
License
MIT
Repository
github
Last release
10 years ago

PostCSS Ignore

GitHub license

PostCSS plugin to let specific css lines and rules untouched by other plugins.

DISCLAIMER: Only tested with Gulp workflows & !ignore flag breaks css if not removed (by this plugin) - usage on own risk so far. If anyone have some ideas e.g. how it would be possible to flag the decl without breaking it - feel free to contribute or find me on Twitter :)

.foo {
    /* Input example */

    z-index: 1337 !ignore;
}
.foo {
  /* Output example */

  z-index: 1337;
}

Usage

First things first:

$ npm install postcss-ignore

Gulp:

gulp.task('scss', function() {
    gulp.src('src/css/*.css')
        .pipe( postcss([ 
            ignore() // <- hide flagged declarations
            
            // other plugins
            
            ])
        )
        
        // maybe some more things
        
        .pipe( postcss([ 
            ignore('last') // <- **unhide** flagged declarations
        ]) )
        .pipe( gulp.dest('dist/css/'))
        .pipe( reload({stream:true}));
});

Note that the ignore('last') call has to be in an other pipe than the initial.