# postcss-selector-not

> PostCSS plugin to transform :not() W3C CSS level 4 pseudo class to :not() CSS level 3 selectors

Latest version **9.0.0** (published 2026-01-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-selector-not
pnpm add postcss-selector-not
yarn add postcss-selector-not
bun add postcss-selector-not
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 9.0.0 |
| Published | 2026-01-14 |
| First published | 2015-04-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=20.19.0 |
| Dependencies | 1 |
| Unpacked size | 5.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1052 |
| Maintainers | jonathantneal, alaguna, romainmenke, moox, semigradsky |
| Keywords | Not, postcss, postcss-plugin, selector |

## Links

- npm: https://www.npmjs.com/package/postcss-selector-not
- Repository: https://github.com/csstools/postcss-plugins
- Homepage: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-selector-not#readme
- Issues: https://github.com/csstools/postcss-plugins/issues
- Funding: https://github.com/sponsors/csstools
- npm.io page: https://npm.io/package/postcss-selector-not

## Dependencies (1)

- [postcss-selector-parser](https://npm.io/package/postcss-selector-parser.md) ^7.1.1

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 9.0.0 (latest) — 2026-01-14
- 8.0.1 — 2024-10-23
- 8.0.0 — 2024-08-03
- 7.0.2 — 2024-02-19
- 7.0.1 — 2023-01-28
- 7.0.0 — 2023-01-24
- 6.0.1 — 2022-07-08
- 6.0.0 — 2022-06-03
- 5.0.0 — 2021-01-31
- 4.0.1 — 2020-12-18
- 4.0.0 — 2018-09-18
- 3.0.1 — 2017-05-15
- 3.0.0 — 2017-05-11
- 2.0.0 — 2015-08-25
- 1.2.1 — 2015-06-16
- … 5 more at https://npm.io/package/postcss-selector-not/versions

## README

# PostCSS Selector Not [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][PostCSS]

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

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

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

/* becomes */

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

> [!CAUTION]
> 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:

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

Use it as a [PostCSS] plugin:

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

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



[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test
[css-url]: https://cssdb.org/#not-pseudo-class
[discord]: https://discord.gg/bUadyRwkJS
[npm-url]: https://www.npmjs.com/package/postcss-selector-not

[PostCSS]: https://github.com/postcss/postcss
[PostCSS Selector Not]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-selector-not
[Selectors 4 Specification]: https://www.w3.org/TR/selectors-4/#negation-pseudo

---
_Source: https://npm.io/package/postcss-selector-not · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
