Socket
Socket
Sign inDemoInstall

postcss-selector-not

Package Overview
Dependencies
7
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.0 to 6.0.0

dist/index.cjs

39

CHANGELOG.md

@@ -1,24 +0,31 @@

# 5.0.0 - 2021-01-31
# Changes to PostCSS Selector Not
### 6.0.0 (June 3, 2022)
- Fixed: default export ([#409](https://github.com/csstools/postcss-plugins/issues/409))
- Fixed: doesn't consider attribute selectors (https://github.com/postcss/postcss-selector-not/issues/23)
- Fixed: unexpected results when `:not` is not a pseudo class function (https://github.com/postcss/postcss-selector-not/issues/28)
### 5.0.0 (January 31, 2021)
- Added: Support for PostCSS v8.
### 4.0.1 (December 18, 2020)
# 4.0.1 - 2020-12-18
- Fixed: error when attribute selector containing :not (https://github.com/postcss/postcss-selector-not/pull/17)
- Fixed: error when attribute selector containing :not ([#17](https://github.com/postcss/postcss-selector-not/pull/17))
### 4.0.0 (September 17, 2017)
# 4.0.0 - 2018-09-17
- Added: compatibility with postcss v7.x
- Added: compatibility with node v6.x
# 3.0.1 - 2017-05-15
### 3.0.1 (May 11, 2015)
- Fixed: incorrect export ([#8](https://github.com/postcss/postcss-selector-not/issues/8))
- Fixed: incorrect export (https://github.com/postcss/postcss-selector-not/issues/8)
# 3.0.0 - 2017-05-11
### 3.0.0 (May 11, 2017)
- Added: compatibility with postcss v6.x
# 2.0.0 - 2015-08-25
### 2.0.0 (August 25, 2015)

@@ -28,27 +35,27 @@ - Removed: compatibility with postcss v4.x

# 1.2.1 - 2015-06-16
### 1.2.1 (June 16, 2015)
- Fixed: selector was updated as an array, which is wrong.
# 1.2.0 - 2015-06-16
### 1.2.0 (June 16, 2015)
- Fixed: spec has been previously misinterpreted and now transform correctly
`:not()` level 4 to collapsed level 3
([#1](https://github.com/postcss/postcss-selector-not/issues/1))
(https://github.com/postcss/postcss-selector-not/issues/1)
- Removed: `lineBreak` option (useless now)
# 1.1.0 - 2015-06-13
### 1.1.0 (June 13, 2015)
- Added: `lineBreak` option
# 1.0.2 - 2015-06-13
### 1.0.2 (June 13, 2015)
- Fixed: support of pseudo classes that use parenthesis
# 1.0.1 - 2015-04-30
### 1.0.1 (April 30, 2015)
- Fixed: the module now works in non babel environments
# 1.0.0 - 2015-04-30
### 1.0.0 (April 30, 2015)
✨ First release
{
"name": "postcss-selector-not",
"version": "5.0.0",
"description": "PostCSS plugin to transform :not() W3C CSS level 4 pseudo class to :not() CSS level 3 selectors",
"keywords": [
"postcss",
"postcss-plugin",
"selectors",
"selector",
"Not"
],
"author": "Maxime Thirouin",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/postcss/postcss-selector-not.git"
},
"main": "dist/index.js",
"files": [
"dist"
],
"dependencies": {
"balanced-match": "^1.0.0"
},
"peerDependencies": {
"postcss": "^8.1.0"
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/cli": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"@babel/register": "^7.11.5",
"eslint": "^7.9.0",
"postcss": "^8.1.0",
"tape": "^5.0.1"
},
"scripts": {
"lint": "eslint ./src/*.js ./test/*.js",
"tape": "tape -r @babel/register test/*.js",
"test": "npm run lint && npm run babelify && npm run tape",
"babelify": "babel src --out-dir dist",
"prepublishOnly": "npm run babelify"
}
"name": "postcss-selector-not",
"description": "PostCSS plugin to transform :not() W3C CSS level 4 pseudo class to :not() CSS level 3 selectors",
"version": "6.0.0",
"contributors": [
{
"name": "Antonio Laguna",
"email": "antonio@laguna.es",
"url": "https://antonio.laguna.es"
},
{
"name": "Romain Menke",
"email": "romainmenke@gmail.com"
},
{
"name": "Maxime Thirouin"
}
],
"license": "MIT",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/csstools"
},
"engines": {
"node": "^12 || ^14 || >=16"
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"default": "./dist/index.mjs"
}
},
"files": [
"CHANGELOG.md",
"LICENSE",
"README.md",
"dist"
],
"dependencies": {
"postcss-selector-parser": "^6.0.10"
},
"peerDependencies": {
"postcss": "^8.3"
},
"scripts": {
"build": "rollup -c ../../rollup/default.js",
"clean": "node -e \"fs.rmSync('./dist', { recursive: true, force: true });\"",
"docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs",
"lint": "npm run lint:eslint && npm run lint:package-json",
"lint:eslint": "eslint ./src --ext .js --ext .ts --ext .mjs --no-error-on-unmatched-pattern",
"lint:package-json": "node ../../.github/bin/format-package-json.mjs",
"prepublishOnly": "npm run clean && npm run build && npm run test",
"test": "node .tape.mjs && npm run test:exports",
"test:exports": "node ./test/_import.mjs && node ./test/_require.cjs",
"test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
},
"homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-selector-not#readme",
"repository": {
"type": "git",
"url": "https://github.com/csstools/postcss-plugins.git",
"directory": "plugins/postcss-selector-not"
},
"bugs": "https://github.com/csstools/postcss-plugins/issues",
"keywords": [
"Not",
"postcss",
"postcss-plugin",
"selector",
"selectors"
],
"csstools": {
"cssdbId": "not-pseudo-class",
"exportName": "postcssSelectorNot",
"humanReadableName": "PostCSS Selector Not",
"specUrl": "https://www.w3.org/TR/selectors-4/#negation-pseudo"
},
"volta": {
"extends": "../../package.json"
}
}

@@ -1,37 +0,57 @@

# postcss-selector-not [![CSS Standard Status](https://cssdb.org/badge/not-pseudo-class.svg)](https://cssdb.org/#not-pseudo-class) [![Build Status](https://travis-ci.org/postcss/postcss-selector-not.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-not)
# PostCSS Selector Not [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
> PostCSS plugin to transform `:not()` W3C CSS level 4 pseudo class to :not() CSS level 3 selectors
[<img alt="npm version" src="https://img.shields.io/npm/v/postcss-selector-not.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/not-pseudo-class.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
http://dev.w3.org/csswg/selectors-4/#negation
[PostCSS Selector Not] transforms :not() W3C CSS level 4 pseudo classes to :not() CSS level 3 selectors following the [Selectors 4 Specification].
[!['Can I use' table](https://caniuse.bitsofco.de/image/css-not-sel-list.png)](https://caniuse.com/#feat=css-not-sel-list)
```pcss
p:not(:first-child, .special) {
color: red;
}
## Installation
/* becomes */
```console
$ npm install postcss postcss-selector-not
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
Using this `input.css`:
Add [PostCSS Selector Not] to your project:
```css
p:not(:first-child, .special) {
color: red;
}
```bash
npm install postcss postcss-selector-not --save-dev
```
you will get:
Use it as a [PostCSS] plugin:
```css
p:not(:first-child):not(.special) {
color: red;
}
```js
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:
## [Changelog](CHANGELOG.md)
| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
| --- | --- | --- | --- | --- | --- |
## [License](LICENSE)
[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
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc