{"id":15392393,"url":"https://github.com/activeguild/css-custom-property-extractor","last_synced_at":"2025-10-28T10:05:15.512Z","repository":{"id":65087145,"uuid":"579670790","full_name":"activeguild/css-custom-property-extractor","owner":"activeguild","description":"Extract css custom properties as constant values that can be used in JS.","archived":false,"fork":false,"pushed_at":"2023-05-01T13:16:10.000Z","size":748,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T08:55:16.205Z","etag":null,"topics":["css","css-custom-property","extract","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/activeguild.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":"2022-12-18T13:40:18.000Z","updated_at":"2024-07-06T14:15:22.000Z","dependencies_parsed_at":"2024-09-19T10:00:53.604Z","dependency_job_id":null,"html_url":"https://github.com/activeguild/css-custom-property-extractor","commit_stats":{"total_commits":48,"total_committers":2,"mean_commits":24.0,"dds":0.02083333333333337,"last_synced_commit":"4e245669ccb1783ae0fc421ba7e4445a8bcc72bc"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fcss-custom-property-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fcss-custom-property-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fcss-custom-property-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activeguild%2Fcss-custom-property-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activeguild","download_url":"https://codeload.github.com/activeguild/css-custom-property-extractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944062,"owners_count":20697948,"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":["css","css-custom-property","extract","typescript"],"created_at":"2024-10-01T15:14:43.726Z","updated_at":"2025-10-28T10:05:10.450Z","avatar_url":"https://github.com/activeguild.png","language":"TypeScript","readme":"\u003ch1 align=\"center\"\u003ecss-custom-property-extractor\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://badge.fury.io/js/css-custom-property-extractor\"\u003e\u003cimg src=\"https://badge.fury.io/js/css-custom-property-extractor.svg\" alt=\"npm version\" height=\"18\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/actions/setup-node\"\u003e\u003cimg alt=\"GitHub Actions status\" src=\"https://github.com/activeguild/css-custom-property-extractor/workflows/automatic%20release/badge.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Intro\n\n- Parse css custom properties and output typescript files.By importing the output typescript files\u003cbr/\u003e\n  ,custom properties can be used type-safely in various libraries.\n- Supports `css` and `sass` and `less`.\n- If you are in a vite environment, use the `css-preprocessoroptions` in `vite.config`.\n\n## Usage\n\n1. Install as `devDependencies`\n\n```shell\nnpm i -D css-custom-property-extractor\n```\n\n2. For example.\n   Parsing [./samples/scss/bootstrap.scss](./samples/scss/bootstrap.scss) outputs the following typescript file.\n\n```shell\nnpx ccpe -i ./samples/scss/bootstrap.scss\n```\n\n```ts\n/**\n *  #0d6efd;\n */\nexport const bsBlue = \"var(--bs-blue)\"\n/**\n *  #6610f2;\n */\nexport const bsIndigo = \"var(--bs-indigo)\"\n/**\n *  #6f42c1;\n */\nexport const bsPurple = \"var(--bs-purple)\"\n...\n```\n\n3. Import and use the output typescript file.\n\n## Command options\n\n| option                    | description                                                                                                                                                                                           |\n| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| -o \\\u003cpath\\\u003e               | output path.                                                                                                                                                                                          |\n| -i,--include \u003cpath\u003e       | include path (glob pattern). (default \\*_/_.?(css \\| scss \\| sass \\| less))                                                                                                                           |\n| -e,--exclude \u003cpath\u003e       | exclude path (glob pattern).                                                                                                                                                                          |\n| -v,--vite \u003cpath \\| false\u003e | Specify the relative path to vite.config.\u003cbr /\u003eRead the [css-preprocessoroptions](https://vitejs.dev/config/shared-options.html#css-preprocessoroptions) property from `vite.config`. (default false) |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiveguild%2Fcss-custom-property-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factiveguild%2Fcss-custom-property-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factiveguild%2Fcss-custom-property-extractor/lists"}