{"id":23625123,"url":"https://github.com/fu1996/var-color-replace-loader","last_synced_at":"2026-05-02T02:32:19.116Z","repository":{"id":57702656,"uuid":"503602217","full_name":"fu1996/var-color-replace-loader","owner":"fu1996","description":"a webpack var color replace loader","archived":false,"fork":false,"pushed_at":"2022-06-18T17:02:27.000Z","size":48,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T21:36:12.282Z","etag":null,"topics":["loader","replace-loader","var-color","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fu1996.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-15T03:32:34.000Z","updated_at":"2022-08-22T10:53:18.000Z","dependencies_parsed_at":"2022-09-26T21:11:19.947Z","dependency_job_id":null,"html_url":"https://github.com/fu1996/var-color-replace-loader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu1996%2Fvar-color-replace-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu1996%2Fvar-color-replace-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu1996%2Fvar-color-replace-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fu1996%2Fvar-color-replace-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fu1996","download_url":"https://codeload.github.com/fu1996/var-color-replace-loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239530423,"owners_count":19654274,"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":["loader","replace-loader","var-color","webpack"],"created_at":"2024-12-27T21:36:29.896Z","updated_at":"2025-11-07T12:30:46.043Z","avatar_url":"https://github.com/fu1996.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# var-color-replace-loader\n\n## Install this loader\n```shell\nnpm i -D var-color-replace-loader\n```\n\n## How to configure\nTake less as an example\n```javascript\n            {\n                test: /\\.less$/,\n                use: ['style-loader', 'css-loader', 'less-loader', {\n                    loader: path.resolve(__dirname, 'loaders/afterBabel'),\n                    options: {\n                        // color map object\n                        colorMap: {\n                            '--color-cyan-1': '#f5f8ff',\n                            '--color-emerald-7': '#049160',\n                            '--color-indigo-5': '#41a7fa',\n                        },\n                    }\n                },]\n            },\n```\nAssume that the contents of the current index.less file are\n```less\nbody {\n    width: 200px;\n    height: 200px;\n    background: #f5f8ff;\n    color: #049160;\n    border-color: #41a7fa;\n    color: #adc;\n}\n```\n\nAfter being processed by the loader, the content will change to the following code\n```css\nbody {\n    width: 200px;\n    height: 200px;\n    background: var(--color-cyan-1);\n    color: var(--color-emerald-7);\n    border-color: var(--color-indigo-5);\n    color: #adc;\n}\n```\n\n## Github\nhttps://github.com/fu1996/var-color-replace-loader\n\nIf it helps you, please light up star. If there is a need, please mention issue.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffu1996%2Fvar-color-replace-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffu1996%2Fvar-color-replace-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffu1996%2Fvar-color-replace-loader/lists"}