diff options
Diffstat (limited to 'node_modules/postcss-unique-selectors')
6 files changed, 0 insertions, 178 deletions
diff --git a/node_modules/postcss-unique-selectors/LICENSE-MIT b/node_modules/postcss-unique-selectors/LICENSE-MIT deleted file mode 100644 index fd0e863a..00000000 --- a/node_modules/postcss-unique-selectors/LICENSE-MIT +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info) - -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. diff --git a/node_modules/postcss-unique-selectors/README.md b/node_modules/postcss-unique-selectors/README.md deleted file mode 100644 index adb14207..00000000 --- a/node_modules/postcss-unique-selectors/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# [postcss][postcss]-unique-selectors - -> Ensure CSS selectors are unique. - -## Install - -With [npm](https://npmjs.org/package/postcss-unique-selectors) do: - -``` -npm install postcss-unique-selectors --save -``` - -## Example - -Selectors are sorted naturally, and deduplicated: - -### Input - -```css -h1,h3,h2,h1 { - color: red -} -``` - -### Output - -```css -h1,h2,h3 { - color: red -} -``` - -## Usage - -See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for -examples for your environment. - -## Contributors - -See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md). - -## License - -MIT © [Ben Briggs](http://beneb.info) - -[postcss]: https://github.com/postcss/postcss diff --git a/node_modules/postcss-unique-selectors/package.json b/node_modules/postcss-unique-selectors/package.json deleted file mode 100644 index ba28e36b..00000000 --- a/node_modules/postcss-unique-selectors/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "postcss-unique-selectors", - "version": "6.0.4", - "description": "Ensure CSS selectors are unique.", - "main": "src/index.js", - "types": "types/index.d.ts", - "files": [ - "LICENSE-MIT", - "src", - "types" - ], - "keywords": [ - "css", - "postcss", - "postcss-plugin" - ], - "license": "MIT", - "homepage": "https://github.com/cssnano/cssnano", - "author": { - "name": "Ben Briggs", - "email": "beneb.info@gmail.com", - "url": "http://beneb.info" - }, - "repository": "cssnano/cssnano", - "dependencies": { - "postcss-selector-parser": "^6.0.16" - }, - "bugs": { - "url": "https://github.com/cssnano/cssnano/issues" - }, - "engines": { - "node": "^14 || ^16 || >=18.0" - }, - "devDependencies": { - "postcss": "^8.4.37" - }, - "peerDependencies": { - "postcss": "^8.4.31" - } -}
\ No newline at end of file diff --git a/node_modules/postcss-unique-selectors/src/index.js b/node_modules/postcss-unique-selectors/src/index.js deleted file mode 100644 index 39cd52fa..00000000 --- a/node_modules/postcss-unique-selectors/src/index.js +++ /dev/null @@ -1,59 +0,0 @@ -'use strict'; -const selectorParser = require('postcss-selector-parser'); - -/** - * @param {string} selectors - * @param {selectorParser.SyncProcessor<void>} callback - * @return {string} - */ -function parseSelectors(selectors, callback) { - return selectorParser(callback).processSync(selectors); -} - -/** - * @param {import('postcss').Rule} rule - * @return {string} - */ -function unique(rule) { - const selector = [...new Set(rule.selectors)]; - selector.sort(); - return selector.join(); -} - -/** - * @type {import('postcss').PluginCreator<void>} - * @return {import('postcss').Plugin} - */ -function pluginCreator() { - return { - postcssPlugin: 'postcss-unique-selectors', - OnceExit(css) { - css.walkRules((nodes) => { - /** @type {string[]} */ - let comments = []; - /** @type {selectorParser.SyncProcessor<void>} */ - const removeAndSaveComments = (selNode) => { - selNode.walk((sel) => { - if (sel.type === 'comment') { - comments.push(sel.value); - sel.remove(); - return; - } else { - return; - } - }); - }; - if (nodes.raws.selector && nodes.raws.selector.raw) { - parseSelectors(nodes.raws.selector.raw, removeAndSaveComments); - nodes.raws.selector.raw = unique(nodes); - } - nodes.selector = parseSelectors(nodes.selector, removeAndSaveComments); - nodes.selector = unique(nodes); - nodes.selectors = nodes.selectors.concat(comments); - }); - }, - }; -} - -pluginCreator.postcss = true; -module.exports = pluginCreator; diff --git a/node_modules/postcss-unique-selectors/types/index.d.ts b/node_modules/postcss-unique-selectors/types/index.d.ts deleted file mode 100644 index e449e8b4..00000000 --- a/node_modules/postcss-unique-selectors/types/index.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -export = pluginCreator; -/** - * @type {import('postcss').PluginCreator<void>} - * @return {import('postcss').Plugin} - */ -declare function pluginCreator(): import('postcss').Plugin; -declare namespace pluginCreator { - let postcss: true; -} -//# sourceMappingURL=index.d.ts.map
\ No newline at end of file diff --git a/node_modules/postcss-unique-selectors/types/index.d.ts.map b/node_modules/postcss-unique-selectors/types/index.d.ts.map deleted file mode 100644 index 359ad19d..00000000 --- a/node_modules/postcss-unique-selectors/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AAsBA;;;GAGG;AACH,kCAFY,OAAO,SAAS,EAAE,MAAM,CA+BnC"}
\ No newline at end of file |
