postcss-selector-not (6.0.1)

Published 2026-02-24 14:03:21 +00:00 by atheaadmin

Installation

registry=
npm install postcss-selector-not@6.0.1
"postcss-selector-not": "6.0.1"

About this package

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

Dependencies

Dependencies

ID Version
postcss-selector-parser ^6.0.10

Peer Dependencies

ID Version
postcss ^8.2

Keywords

Not postcss postcss-plugin selector selectors
Details
npm
2026-02-24 14:03:21 +00:00
1
MIT
latest
3.8 KiB
Assets (1)
Versions (1) View all
6.0.1 2026-02-24