{"id":21531630,"url":"https://github.com/hwantage/postcss-delete-duplicate-selector","last_synced_at":"2026-02-21T22:04:47.113Z","repository":{"id":215189879,"uuid":"738335308","full_name":"hwantage/postcss-delete-duplicate-selector","owner":"hwantage","description":"PostCSS plugin delete duplicate css selector in the file","archived":false,"fork":false,"pushed_at":"2024-12-01T07:05:37.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-26T02:41:55.540Z","etag":null,"topics":["npm-package","postcss","postcss-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/postcss-delete-duplicate-selector","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hwantage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-03T01:54:10.000Z","updated_at":"2024-12-01T07:05:40.000Z","dependencies_parsed_at":"2024-01-22T02:44:15.819Z","dependency_job_id":"db30d904-a456-4fa8-b69d-09570d36b014","html_url":"https://github.com/hwantage/postcss-delete-duplicate-selector","commit_stats":null,"previous_names":["hwantage/postcss-delete-duplicate-selector"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hwantage/postcss-delete-duplicate-selector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwantage%2Fpostcss-delete-duplicate-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwantage%2Fpostcss-delete-duplicate-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwantage%2Fpostcss-delete-duplicate-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwantage%2Fpostcss-delete-duplicate-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hwantage","download_url":"https://codeload.github.com/hwantage/postcss-delete-duplicate-selector/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hwantage%2Fpostcss-delete-duplicate-selector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29694823,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["npm-package","postcss","postcss-plugin"],"created_at":"2024-11-24T02:15:31.836Z","updated_at":"2026-02-21T22:04:47.075Z","avatar_url":"https://github.com/hwantage.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n**[PostCSS](https://github.com/postcss/postcss)** plugin for delete duplicate css selector in the file.\n\nThis plugin deletes duplicate css selectors. It removes the duplicate selector at the bottom, leaving the top one.\n\n\n\n**input.css:**\n\n```css\n.hello {\n  width: 100%;\n}\n.hello {\n  padding-left: 10px;\n}\n.other {\n\tdisplay: none;\n}\n```\n\n**output.css:**\n\n```css\n.hello {\n  width: 100%;\n}\n.other {\n\tdisplay: none;\n}\n```\n\n\n\u003cbr/\u003e\n\n## **Installation**\n\n`$ npm i -D postcss postcss-cli`\n\n`$ npm i -D postcss-delete-duplicate-selector`\n\n\u003cbr/\u003e\n\n## **Usage 1**\n\n**package.json:**\n\n```jsx\n{\n\t\"scripts\": {\n\t\t\"build\": \"postcss input.css --use postcss-delete-duplicate-selector --output output.css\"\n\t},\n\t\"devDependencies\": {\n\t\t\"postcss\": \"^8.4.32\",\n\t\t\"postcss-cli\": \"^11.0.0\",\n\t\t\"postcss-delete-duplicate-selector\": \"^1.2.2\"\n\t}\n}\n```\n\nand then `npm run build`\n\n\n\n## **Usage 2**\n\nOr you can use `postcss.config.js` file. Create a `postcss.config.js` file in your root directory.\n\n**postcss.config.js:**\n\n```\nmodule.exports = {\n  plugins: [\n    require('postcss-delete-duplicate-selector')\n  ],\n};\n```\n\nChange the build script to look like this\n\n**package.json:**\n\n```jsx\n{\n\t\"scripts\": {\n\t\t\"build\": \"postcss input.css --output output.css\"\n\t},\n\t\"devDependencies\": {\n\t\t\"postcss\": \"^8.4.32\",\n\t\t\"postcss-cli\": \"^11.0.0\",\n\t\t\"postcss-delete-duplicate-selector\": \"^1.2.2\"\n\t}\n}\n```\n\nand then `npm run build`\n\nSee **[PostCSS](https://github.com/postcss/postcss)** docs for **[examples regarding usage](https://github.com/postcss/postcss#usage)**.\n\n\n\u003cbr/\u003e\n\n## **Options**\n\nN/A\n\n\n\u003cbr/\u003e\n\n## **Additional Info**\n\nYou can merge the two files with the command below.\n\n```shell\n# linux\n$ cat a.css b.css \u003e input.css\n\n# windows\n\u003e type a.css b.css \u003e input.css\n\n```\n\n\u003cbr/\u003e\n\nThis plugin will delete all comments.\n\n**input.css:**\n\n```css\n/*This is the comment1*/\n.hello {\n  width: 100%;\n}\n/*This is the comment2*/\n```\n\n**output.css:**\n\n```css\n.hello {\n  width: 100%;\n}\n```\n\n\u003cbr/\u003e\nThis plugin does not consider whitespace between selectors. Therefore, it's recommended to run it after the CSS minify or CSS prettify.\n\n**input.css:**\n\n```css\nh1, h2 {\n  width: 100%;\n}\nh1,h2 {\n  width: 100%;\n}\n```\n\n**output.css:** (result is same)\n\n```css\nh1, h2 {\n  width: 100%;\n}\nh1,h2 {\n  width: 100%;\n}\n```\n\n\u003cbr/\u003e\nDeduplication is not performed for atrules like @media. However, deduplication is performed on declarations that are exactly the same.\n\ninput.css:\n\n```css\n@font-face {\n  font-weight: 700;\n}\n@font-face {\n  font-weight: 500;\n}\n@font-face {\n  font-weight: 500;\n}\n```\n\noutput.css:\n\n```css\n@font-face {\n  font-weight: 700;\n}\n@font-face {\n  font-weight: 500;\n}\n```\n\n\u003cbr/\u003e\n\n## **License**\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhwantage%2Fpostcss-delete-duplicate-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhwantage%2Fpostcss-delete-duplicate-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhwantage%2Fpostcss-delete-duplicate-selector/lists"}