{"_id":"@devteaa/postcss-combine-duplicated-selectors","_rev":"1-107c19988aa2024a7678945db865bcf5","name":"@devteaa/postcss-combine-duplicated-selectors","dist-tags":{"latest":"10.0.5"},"versions":{"10.0.4":{"name":"@devteaa/postcss-combine-duplicated-selectors","version":"10.0.4","description":"automatically keep css selectors unique","main":"src/index.js","types":"types/index.d.ts","scripts":{"commit":"commit","test":"run-s test:*","test:unit":"ava","test:lint-js":"eslint --fix --ext md,js .","test:lint-md":"remark *.md -q --no-stdout","test:types":"dtslint types","commitlint":"commitlint --from HEAD~1","prepare":"husky install"},"keywords":["postcss-plugin","selector"],"author":{"name":"devteaa","email":"devteaa@protonmail.com","url":"https://github.com/devTeaa"},"repository":{"type":"git","url":"git+https://github.com/devTeaa/postcss-combine-duplicated-selectors.git"},"homepage":"https://github.com/devTeaa/postcss-combine-duplicated-selectors","bugs":{"url":"https://github.com/devTeaa/postcss-combine-duplicated-selectors/issues"},"license":"MIT","peerDependencies":{"postcss":"^8.1.0"},"dependencies":{"postcss-selector-parser":"^6.0.4"},"devDependencies":{"@commitlint/cli":"17.8.0","@commitlint/config-conventional":"17.8.0","@commitlint/prompt-cli":"17.8.0","ava":"3.15.0","dtslint":"4.2.1","eslint":"8.51.0","eslint-config-google":"0.14.0","eslint-plugin-ava":"14.0.0","eslint-plugin-markdown":"3.0.1","husky":"8.0.3","npm-run-all":"4.1.5","postcss":"8.4.31","postcss-less":"6.0.0","postcss-nested":"6.0.1","postcss-scss":"4.0.9","remark-cli":"11.0.0","remark-preset-lint-consistent":"5.1.2","remark-preset-lint-recommended":"6.1.3","remark-validate-links":"12.1.1","typescript":"5.2.2"},"engines":{"node":"^14.0.0 || ^16.0.0 || >=18.0.0"},"eslintConfig":{"root":true,"parserOptions":{"ecmaVersion":8},"env":{"es6":true,"node":true},"extends":["eslint:recommended","google","plugin:markdown/recommended"],"rules":{"prefer-arrow-callback":"error","prefer-const":"error","prefer-template":"error"}},"remarkConfig":{"plugins":["preset-lint-recommended","preset-lint-consistent","validate-links"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"renovate":{"extends":["config:base"],"automerge":true,"major":{"automerge":false},"lockFileMaintenance":{"enabled":true},"semanticPrefix":"chore:","semanticCommitScope":""},"_id":"@devteaa/postcss-combine-duplicated-selectors@10.0.4","gitHead":"68f31272a1cf741c9dbf0e6e5ed6d0ddf31e7648","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-nplTp8Gj4teaQRK7VxvO56QqDdkrKDjNqRK5nV3n8spAo6P++T+Ur/QKVgXkIAO9DfKIIopE/f7SVZLIiJbNHg==","shasum":"6c715ae98b17916143222b8ac705004db5bccab7","tarball":"https://registry.npmjs.org/@devteaa/postcss-combine-duplicated-selectors/-/postcss-combine-duplicated-selectors-10.0.4.tgz","fileCount":5,"unpackedSize":14683,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCylND0xtspolMFFjFzR2vQkjAMiuB1QGKEWeutYe5KzAIgelF1Yt0Y+YfyhL/pF0c7J4CIbgmAd0zD2fIhHpRSlYk="}]},"_npmUser":{"name":"devteaa","email":"devtea@protonmail.com"},"directories":{},"maintainers":[{"name":"devteaa","email":"devtea@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-combine-duplicated-selectors_10.0.4_1707720830955_0.7060102609044179"},"_hasShrinkwrap":false},"10.0.5":{"name":"@devteaa/postcss-combine-duplicated-selectors","version":"10.0.5","description":"automatically keep css selectors unique","main":"src/index.js","types":"types/index.d.ts","scripts":{"commit":"commit","test":"run-s test:*","test:unit":"ava","test:lint-js":"eslint --fix --ext md,js .","test:lint-md":"remark *.md -q --no-stdout","test:types":"dtslint types","commitlint":"commitlint --from HEAD~1","prepare":"husky install"},"keywords":["postcss-plugin","selector"],"author":{"name":"devteaa","email":"devteaa@protonmail.com","url":"https://github.com/devTeaa"},"repository":{"type":"git","url":"git+https://github.com/devTeaa/postcss-combine-duplicated-selectors.git"},"homepage":"https://github.com/devTeaa/postcss-combine-duplicated-selectors","bugs":{"url":"https://github.com/devTeaa/postcss-combine-duplicated-selectors/issues"},"license":"MIT","peerDependencies":{"postcss":"^8.1.0"},"dependencies":{"postcss-selector-parser":"^6.0.4"},"devDependencies":{"@commitlint/cli":"17.8.0","@commitlint/config-conventional":"17.8.0","@commitlint/prompt-cli":"17.8.0","ava":"3.15.0","dtslint":"4.2.1","eslint":"8.51.0","eslint-config-google":"0.14.0","eslint-plugin-ava":"14.0.0","eslint-plugin-markdown":"3.0.1","husky":"8.0.3","npm-run-all":"4.1.5","postcss":"8.4.31","postcss-less":"6.0.0","postcss-nested":"6.0.1","postcss-scss":"4.0.9","remark-cli":"11.0.0","remark-preset-lint-consistent":"5.1.2","remark-preset-lint-recommended":"6.1.3","remark-validate-links":"12.1.1","typescript":"5.2.2"},"engines":{"node":"^14.0.0 || ^16.0.0 || >=18.0.0"},"eslintConfig":{"root":true,"parserOptions":{"ecmaVersion":8},"env":{"es6":true,"node":true},"extends":["eslint:recommended","google","plugin:markdown/recommended"],"rules":{"prefer-arrow-callback":"error","prefer-const":"error","prefer-template":"error"}},"remarkConfig":{"plugins":["preset-lint-recommended","preset-lint-consistent","validate-links"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"renovate":{"extends":["config:base"],"automerge":true,"major":{"automerge":false},"lockFileMaintenance":{"enabled":true},"semanticPrefix":"chore:","semanticCommitScope":""},"_id":"@devteaa/postcss-combine-duplicated-selectors@10.0.5","gitHead":"c1edc61ba5e9d414290d2dede629ae2f4d1b02cc","_nodeVersion":"18.18.0","_npmVersion":"9.8.1","dist":{"integrity":"sha512-/JmHXoDbDM7gitpcOhlowGNVYB3VQJ+nNM7myVMRZS3CgAQMRK2mUgCm1hQq+zUCbZev2hrHbvd74GNEzQOiMw==","shasum":"b544f297884df240fa98536a04f772dd992262a7","tarball":"https://registry.npmjs.org/@devteaa/postcss-combine-duplicated-selectors/-/postcss-combine-duplicated-selectors-10.0.5.tgz","fileCount":5,"unpackedSize":14763,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9J4kCAEYfid7MA000JsQG/Hew/DApUvKCP/GQTVPS8gIhANPt63A3OA9ACcxW7zH1lZibW1awWmiFf4+HlYspsju6"}]},"_npmUser":{"name":"devteaa","email":"devtea@protonmail.com"},"directories":{},"maintainers":[{"name":"devteaa","email":"devtea@protonmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-combine-duplicated-selectors_10.0.5_1707726181842_0.9142642001249803"},"_hasShrinkwrap":false}},"time":{"created":"2024-02-12T06:53:50.849Z","10.0.4":"2024-02-12T06:53:51.100Z","modified":"2024-02-12T08:23:02.213Z","10.0.5":"2024-02-12T08:23:02.014Z"},"maintainers":[{"name":"devteaa","email":"devtea@protonmail.com"}],"description":"automatically keep css selectors unique","homepage":"https://github.com/devTeaa/postcss-combine-duplicated-selectors","keywords":["postcss-plugin","selector"],"repository":{"type":"git","url":"git+https://github.com/devTeaa/postcss-combine-duplicated-selectors.git"},"author":{"name":"devteaa","email":"devteaa@protonmail.com","url":"https://github.com/devTeaa"},"bugs":{"url":"https://github.com/devTeaa/postcss-combine-duplicated-selectors/issues"},"license":"MIT","readme":"# Postcss combine duplicated selectors\n\n## This fork added 2 features:\n- combines class with different data-v but similar props\n- remove dark prefix if there is class without dark prefix with same props\n\n<!-- current project status -->\n\n[![npm](https://img.shields.io/npm/v/postcss-combine-duplicated-selectors.svg)](https://www.npmjs.com/package/postcss-combine-duplicated-selectors)\n[![build status](https://github.com/ChristianMurphy/postcss-combine-duplicated-selectors/workflows/CI/badge.svg)](https://github.com/ChristianMurphy/postcss-combine-duplicated-selectors/actions)\n[![dependency status](https://david-dm.org/ChristianMurphy/postcss-combine-duplicated-selectors.svg)](https://david-dm.org/ChristianMurphy/postcss-combine-duplicated-selectors)\n[![devDependency status](https://david-dm.org/ChristianMurphy/postcss-combine-duplicated-selectors/dev-status.svg)](https://david-dm.org/ChristianMurphy/postcss-combine-duplicated-selectors?type=dev)\n\nAutomatically detects and combines duplicated css selectors so you don't have to\n:smile:\n\n## Usage\n\n### Requirements\n\nIn order to use this you will need to have [postcss](https://github.com/postcss/postcss) installed. Depending on whether or not you want to use the CLI you need to install [postcss-cli](https://github.com/postcss/postcss-cli).\n\n```bash\nnpm install --save-dev postcss postcss-combine-duplicated-selectors\n# or\nyarn add --dev postcss postcss-combine-duplicated-selectors\n```\n\n### Using PostCSS JS API\n\n```js\n'use strict';\n\nconst fs = require('fs');\nconst postcss = require('postcss');\nconst css = fs.readFileSync('src/app.css');\n\npostcss([require('postcss-combine-duplicated-selectors')])\n    .process(css, {from: 'src/app.css', to: 'app.css'})\n    .then((result) => {\n      fs.writeFileSync('app.css', result.css);\n      if (result.map) fs.writeFileSync('app.css.map', result.map);\n    });\n```\n\n### Using PostCSS CLI\n\n```sh\npostcss style.css --use postcss-combine-duplicated-selectors --output newcss.css\n```\n\n### Using Vite\n\nIn a `postcss.config.js` file :\n\n```js\nmodule.exports = {\n  plugins: [require('postcss-combine-duplicated-selectors')],\n};\n```\n\n## Example\n\nInput\n\n```css\n.module {\n  color: green;\n}\n.another-module {\n  color: blue;\n}\n.module {\n  background: red;\n}\n.another-module {\n  background: yellow;\n}\n```\n\nOutput\n\n```css\n.module {\n  color: green;\n  background: red;\n}\n.another-module {\n  color: blue;\n  background: yellow;\n}\n```\n\n### Duplicated Properties\n\nDuplicated properties can optionally be combined.\n\nSet the `removeDuplicatedProperties` option to `true` to enable.\n\n```js\nconst postcss = require('postcss');\nconst combineSelectors = require('postcss-combine-duplicated-selectors');\n\npostcss([combineSelectors({removeDuplicatedProperties: true})]);\n```\n\nWhen enabled the following css\n\n```css\n.a {\n  height: 10px;\n  background: orange;\n  background: rgba(255, 165, 0, 0.5);\n}\n```\n\nwill combine into\n\n```css\n.a {\n  height: 10px;\n  background: rgba(255, 165, 0, 0.5);\n}\n```\n\nIn order to limit this to only combining properties when the values are equal, set the `removeDuplicatedValues` option to `true` instead. This could clean up duplicated properties, but allow for conscious duplicates such as fallbacks for custom properties.\n\n```js\nconst postcss = require('postcss');\nconst combineSelectors = require('postcss-combine-duplicated-selectors');\n\npostcss([combineSelectors({removeDuplicatedValues: true})]);\n```\n\nThis will transform the following css\n\n```css\n.a {\n  height: 10px;\n}\n\n.a {\n  width: 20px;\n  background: var(--custom-color);\n  background: rgba(255, 165, 0, 0.5);\n}\n```\n\ninto\n\n```css\n.a {\n  height: 10px;\n  width: 20px;\n  background: var(--custom-color);\n  background: rgba(255, 165, 0, 0.5);\n}\n```\n\n### Media Queries\n\nIf you have code with media queries, pass code through [_postcss-combine-media-query_](https://github.com/SassNinja/postcss-combine-media-query) or [_css-mquery-packer_](https://github.com/n19htz/css-mquery-packer) before _postcss-combine-duplicated-selectors_ to ensure optimal results.\n","readmeFilename":"README.md"}