{"id":13630948,"url":"https://github.com/komachi/usedcss","last_synced_at":"2025-04-16T01:41:23.529Z","repository":{"id":57152442,"uuid":"55704497","full_name":"komachi/usedcss","owner":"komachi","description":"PostCSS plugin which helps you extract only used styles.","archived":false,"fork":false,"pushed_at":"2018-08-28T15:14:01.000Z","size":18,"stargazers_count":54,"open_issues_count":3,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T03:32:14.807Z","etag":null,"topics":["postcss-plugins"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/komachi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-07T15:09:35.000Z","updated_at":"2025-01-21T00:35:54.000Z","dependencies_parsed_at":"2022-08-27T18:41:09.917Z","dependency_job_id":null,"html_url":"https://github.com/komachi/usedcss","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komachi%2Fusedcss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komachi%2Fusedcss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komachi%2Fusedcss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/komachi%2Fusedcss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/komachi","download_url":"https://codeload.github.com/komachi/usedcss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248450117,"owners_count":21105623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["postcss-plugins"],"created_at":"2024-08-01T22:02:04.206Z","updated_at":"2025-04-16T01:41:23.509Z","avatar_url":"https://github.com/komachi.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# usedcss\n\n\u003ePostCSS plugin which helps you extract only used styles. Unlike [uncss](https://github.com/giakki/uncss) and others does not render your pages to find used classes, but instead parse it statically, which can be beneficial in some cases. Also support simple Angular's ng-class parsing. And also, due to awesomeness of PostCSS, it works with LESS and SCSS via PostCSS syntaxes.\n\n```html\n\u003c!--- HTML file --\u003e\n\u003cdiv class=\"test\"\u003e\u003c/div\u003e\n```\n\n```css\n/* Input */\n.test { color: #000; }\n.test2 { color: #fff; }\n```\n\n```css\n/* Output */\n.test { color: #000; }\n```\n\n## Installation\n\n```\nnpm i usedcss --save\n```\n\n## Options\n\n### html\n\nType: `array` of [globs](https://github.com/isaacs/node-glob)\n*At least html or js option is required*\n\nHTML files to check css selector usage against them.\n\n### js\n\nType: `array` of [globs](https://github.com/isaacs/node-glob)\n*At least html or js option is required*\n\nJS files to check css selector usage against them.\n\n### ignore\n\nType: `array` of `strings`\n\nSaves ignored selectors even if they are not presented in DOM.\n\n## ignoreRegexp\n\nType: `array` of `regexps`\n\nUse it to save selectors based on regexp.\n\n## ngclass\n\nType: `boolean`\n\nDefault: `false`\n\nParse or not to parse `ng-class` statements.\n\n## ignoreNesting\n\nType: `boolean`\n\nDefault: `false`\n\nIgnore nesting so `.class1 .class2` will be saved even if there is element with `class2`, but it's not nested with `class1`. Useful if you use templates.\n\n## templateMode\n\nType: `boolean`\n\nDefault: `false`\n\nUseful if you run usedcss against nested templates. It split selectors so if you have an element with class `class1` in one file and an element with class `class2` in another one, it will save rule with `.class1 .class2` selector.\n\n## templateCache\n\nType: `boolean`\n\nDefault: `false`\n\nCheck also for html presented in [Angular's $templateCache](https://docs.angularjs.org/api/ng/service/$templateCache). If you want to use this option, `js` option is required.\n\n## Usage\n\nCheck out [PostCSS documentation](https://github.com/postcss/postcss#usage) on how to use PostCSS plugins.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomachi%2Fusedcss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkomachi%2Fusedcss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkomachi%2Fusedcss/lists"}