You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
mahdi 0cb8d673d7 update 2 years ago
..
dist update 2 years ago
CHANGELOG.md update 2 years ago
LICENSE update 2 years ago
README.md update 2 years ago
package.json update 2 years ago

README.md

PostCSS Selector Not PostCSS Logo

npm version CSS Standard Status Build Status Discord

PostCSS Selector Not transforms :not() W3C CSS level 4 pseudo classes to :not() CSS level 3 selectors following the Selectors 4 Specification.

p:not(:first-child, .special) {
	color: red;
}

/* becomes */

p:not(:first-child):not(.special) {
	color: red;
}

Only lists of simple selectors (:not(.a, .b)) will work as expected. Complex selectors (:not(.a > .b, .c ~ .d)) can not be downgraded.

Usage

Add PostCSS Selector Not to your project:

npm install postcss postcss-selector-not --save-dev

Use it as a PostCSS plugin:

const postcss = require('postcss');
const postcssSelectorNot = require('postcss-selector-not');

postcss([
	postcssSelectorNot(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);

PostCSS Selector Not runs in all Node environments, with special instructions for:

Node PostCSS CLI Webpack Create React App Gulp Grunt