Skip to content

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

License

Notifications You must be signed in to change notification settings

colorlight4/postcss-ignore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published