# postcss-unnot

> Remove :not selectors in CSS

Latest version **1.0.2** (published 2015-10-24) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install postcss-unnot
pnpm add postcss-unnot
yarn add postcss-unnot
bun add postcss-unnot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-10-24 |
| First published | 2015-10-04 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.12.0 |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Jonathan Neal |
| Maintainers | jonathantneal |
| Keywords | postcss, css, postcss-plugin, oldie, nots, pseudos, classes, selectors |

## Links

- npm: https://www.npmjs.com/package/postcss-unnot
- Repository: https://github.com/jonathantneal/postcss-unnot
- Issues: https://github.com/jonathantneal/postcss-unnot/issues
- npm.io page: https://npm.io/package/postcss-unnot

## Dependencies (2)

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

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-10-24
- 1.0.1 — 2015-10-04
- 1.0.0 — 2015-10-04

## README

# UnNot [![Build Status][ci-img]][ci]

<img align="right" width="135" height="95" src="http://postcss.github.io/postcss/logo-leftp.png" title="Philosopher’s stone, logo of PostCSS">

[UnNot] removes `:not` selectors while preserving other selectors. This can be useful for outputting CSS for old browsers like Internet Explorer 8.

```css
/* before */

.a, .b:not(.c), d {
    color: red;
}

/* after */

.a, .d {
    color: red;
}
```

## Usage

Add [UnNot] to your build tool:

```bash
npm install postcss-unnot --save-dev
```

#### Node

```js
require('postcss-unnot')({ /* options */ }).process(YOUR_CSS);
```

#### PostCSS

Add [PostCSS] to your build tool:

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

Load [UnNot] as a PostCSS plugin:

```js
postcss([
    require('postcss-unnot')({ /* options */ })
]);
```

#### Gulp

Add [Gulp PostCSS] to your build tool:

```bash
npm install gulp-postcss --save-dev
```

Enable [UnNot] within your Gulpfile:

```js
var postcss = require('gulp-postcss');

gulp.task('css', function () {
    return gulp.src('./css/src/*.css').pipe(
        postcss([
            require('postcss-unnot')({ /* options */ })
        ])
    ).pipe(
        gulp.dest('./css')
    );
});
```

#### Grunt

Add [Grunt PostCSS] to your build tool:

```bash
npm install grunt-postcss --save-dev
```

Enable [UnNot] within your Gruntfile:

```js
grunt.loadNpmTasks('grunt-postcss');

grunt.initConfig({
    postcss: {
        options: {
            processors: [
                require('postcss-unnot')({ /* options */ })
            ]
        },
        dist: {
            src: 'css/*.css'
        }
    }
});
```

### Options

#### `method`

Type: `String`  
Default: `'remove'`

##### `remove`
Remove any selectors with `:not` functions.
```css
/* before */

.a, .b:not(.c), d {
    color: red;
}

/* after */

.a, .d {
    color: red;
}
```

##### `move`
Move any selectors with `:not` functions into a cloned rule.
```css
/* before */

.a, .b:not(.c), .d {}

/* after */

.b:not(.c) {
    color: red;
}

.a, .d {
    color: red;
}
```

##### `pseudo`
Remove only the `:not` functions from selectors.
```css
/* before */

.a, .b:not(.c), .d {
    color: red;
}

/* after */

.a, .b, .d {
    color: red;
}
```

##### `warn`
Warn when a `:not` function is used.

[ci]: https://travis-ci.org/jonathantneal/postcss-unnot
[ci-img]: https://travis-ci.org/jonathantneal/postcss-unnot.svg
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[UnNot]: https://github.com/jonathantneal/postcss-unnot

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