css-exclude
get rid of ugly third party selectors
Motivation
Overwriting long selectors is a pain and might cause unmaintainable code.
css-exclude is a post processor that allows you to choose which of those selectors don't belong in your final stylehsheet.
Just by writing a css comment.
How does it work?
css-exclude is a postcss processor like other famous modules e.g. autoprefixer or webpcss. It supports vanilla css and any preprocessor which supports inline source maps. For more information on compatibility take a look at the tests for vanilla css, sass and less
Example
vendor.less
}
main.less
; /* * @exclude * @file vendor.less * @selector '#nasty * tr.heading' */
result.css
/* * @exclude * @file vendor.less * @selector '#nasty * tr.heading' */
Usage
Grunt
As css-exclude is a postcss plugin it does not need a custom grunt plugin but can be used with the grunt-postcss plugin.
$ npm install grunt-postcss css-exclude --save-dev
grunt;
Gulp
As css-exclude is a postcss plugin it does not need a custom gulp plugin but can be used with the gulp-postcss plugin.
$ npm install gulp-postcss css-exclude --save-dev
var postcss = ;var gulp = ; gulp;
Tests
Run unit tests:
npm install
npm test
License
MIT (http://www.opensource.org/licenses/mit-license.php)