This commit is contained in:
Iliyan Angelov
2025-09-14 23:24:25 +03:00
commit c67067a2a4
71311 changed files with 6800714 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
# Changes to PostCSS Selector Not
### 6.0.1 (July 8, 2022)
- Fixed: Case insensitive `:not` matching.
### 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)
- Fixed: error when attribute selector containing :not (https://github.com/postcss/postcss-selector-not/pull/17)
### 4.0.0 (September 17, 2017)
- Added: compatibility with postcss v7.x
- Added: compatibility with node v6.x
### 3.0.1 (May 11, 2015)
- Fixed: incorrect export (https://github.com/postcss/postcss-selector-not/issues/8)
### 3.0.0 (May 11, 2017)
- Added: compatibility with postcss v6.x
### 2.0.0 (August 25, 2015)
- Removed: compatibility with postcss v4.x
- Added: compatibility with postcss v5.x
### 1.2.1 (June 16, 2015)
- Fixed: selector was updated as an array, which is wrong.
### 1.2.0 (June 16, 2015)
- Fixed: spec has been previously misinterpreted and now transform correctly
`:not()` level 4 to collapsed level 3
(https://github.com/postcss/postcss-selector-not/issues/1)
- Removed: `lineBreak` option (useless now)
### 1.1.0 (June 13, 2015)
- Added: `lineBreak` option
### 1.0.2 (June 13, 2015)
- Fixed: support of pseudo classes that use parenthesis
### 1.0.1 (April 30, 2015)
- Fixed: the module now works in non babel environments
### 1.0.0 (April 30, 2015)
✨ First release

20
frontend/node_modules/postcss-selector-not/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017 Maxime Thirouin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

57
frontend/node_modules/postcss-selector-not/README.md generated vendored Normal file
View File

@@ -0,0 +1,57 @@
# PostCSS Selector Not [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
[<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]
[PostCSS Selector Not] transforms :not() W3C CSS level 4 pseudo classes to :not() CSS level 3 selectors following the [Selectors 4 Specification].
```pcss
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:
```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 */);
```
[PostCSS Selector Not] runs in all Node environments, with special
instructions for:
| [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) |
| --- | --- | --- | --- | --- | --- |
[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

View File

@@ -0,0 +1 @@
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=e(require("postcss-selector-parser"));const o=()=>({postcssPlugin:"postcss-selector-not",Rule:(e,{result:o})=>{if(e.selector&&e.selector.toLowerCase().includes(":not("))try{const o=s.default().astSync(e.selector);o.walkPseudos((e=>{if(":not"!==e.value.toLowerCase())return;if(!e.nodes||e.nodes.length<2)return;const o=[];e.nodes.forEach((e=>{!function(e){e.spaces&&(e.spaces.after="",e.spaces.before=""),e.nodes&&e.nodes.length>0&&(e.nodes[0]&&e.nodes[0].spaces&&(e.nodes[0].spaces.before=""),e.nodes[e.nodes.length-1]&&e.nodes[e.nodes.length-1].spaces&&(e.nodes[e.nodes.length-1].spaces.after=""))}(e);const t=s.default.pseudo({value:":not",nodes:[e]});o.push(t)})),e.replaceWith(...o)}));const t=o.toString();t!==e.selector&&e.replaceWith(e.clone({selector:t}))}catch(s){e.warn(o,`Failed to parse selector "${e.selector}"`)}}});o.postcss=!0,module.exports=o;

View File

@@ -0,0 +1,3 @@
import type { PluginCreator } from 'postcss';
declare const creator: PluginCreator<never>;
export default creator;

View File

@@ -0,0 +1 @@
import e from"postcss-selector-parser";const s=()=>({postcssPlugin:"postcss-selector-not",Rule:(s,{result:o})=>{if(s.selector&&s.selector.toLowerCase().includes(":not("))try{const o=e().astSync(s.selector);o.walkPseudos((s=>{if(":not"!==s.value.toLowerCase())return;if(!s.nodes||s.nodes.length<2)return;const o=[];s.nodes.forEach((s=>{!function(e){e.spaces&&(e.spaces.after="",e.spaces.before=""),e.nodes&&e.nodes.length>0&&(e.nodes[0]&&e.nodes[0].spaces&&(e.nodes[0].spaces.before=""),e.nodes[e.nodes.length-1]&&e.nodes[e.nodes.length-1].spaces&&(e.nodes[e.nodes.length-1].spaces.after=""))}(s);const t=e.pseudo({value:":not",nodes:[s]});o.push(t)})),s.replaceWith(...o)}));const t=o.toString();t!==s.selector&&s.replaceWith(s.clone({selector:t}))}catch(e){s.warn(o,`Failed to parse selector "${s.selector}"`)}}});s.postcss=!0;export{s as default};

View File

@@ -0,0 +1,84 @@
{
"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.1",
"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.2"
},
"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"
}
}