{"id":16996384,"url":"https://github.com/maqi1520/postcss-multiple-themes","last_synced_at":"2025-04-12T05:41:40.860Z","repository":{"id":38173460,"uuid":"406722469","full_name":"maqi1520/postcss-multiple-themes","owner":"maqi1520","description":"PostCSS 多皮肤插件","archived":false,"fork":false,"pushed_at":"2023-01-07T11:12:14.000Z","size":1837,"stargazers_count":6,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T12:01:39.095Z","etag":null,"topics":["less","postcss-plugin","sass"],"latest_commit_sha":null,"homepage":"https://maqi1520.github.io/postcss-multiple-themes/","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/maqi1520.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":"2021-09-15T10:49:27.000Z","updated_at":"2022-11-16T08:33:08.000Z","dependencies_parsed_at":"2023-02-07T00:15:56.792Z","dependency_job_id":null,"html_url":"https://github.com/maqi1520/postcss-multiple-themes","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maqi1520%2Fpostcss-multiple-themes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maqi1520%2Fpostcss-multiple-themes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maqi1520%2Fpostcss-multiple-themes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maqi1520%2Fpostcss-multiple-themes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maqi1520","download_url":"https://codeload.github.com/maqi1520/postcss-multiple-themes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525162,"owners_count":21118617,"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":["less","postcss-plugin","sass"],"created_at":"2024-10-14T03:52:16.879Z","updated_at":"2025-04-12T05:41:40.823Z","avatar_url":"https://github.com/maqi1520.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostCSS Multiple Themes\n\n[PostCSS] plugin for generate themes css.\n\n[postcss]: https://github.com/postcss/postcss\n\nwork with webpack\n\npick the color props and add prefix class name\n\ndefault choose `[\"color\", \"background\", \"border\", \"box-shadow\", \"stroke\"]`\n\n## add file name to js\n\ndefault-theme.less\ndark-theme.less\n\n### JS\n\n```js\nimport \"./default-theme.less\";\nimport \"./dark-theme.less\";\n```\n\n### component.less\n\n```\n.box{\n  width: 100px;\n  height: 100px;\n  border: 1px solid @border;\n  background-color: @bg;\n  color: @color;\n}\n```\n\n### default-theme.less\n\n```\n@import \"./component\";\n\n@border: #333;\n@color: #000;\n@bg: #fff;\n```\n\n### dark-theme.less\n\n```\n@import \"./component\";\n\n@border: #999;\n@color: #fff;\n@bg: #000;\n```\n\n### output css\n\n```css\n.box {\n  width: 100px;\n  height: 100px;\n  border: 1px solid #333;\n  background-color: #fff;\n  color: #000;\n}\n.dark .box {\n  border: 1px solid #999;\n  background-color: #000;\n  color: #fff;\n}\n```\n\n## Usage\n\n**Step 1:** Install plugin:\n\n```sh\nnpm install --save-dev postcss postcss-multiple-themes\n```\n\n**Step 2:** Check you project for existed PostCSS config: `postcss.config.js`\nin the project root, `\"postcss\"` section in `package.json`\nor `postcss` in bundle config.\n\nIf you do not use PostCSS, add it according to [official docs]\nand set this plugin in settings.\n\n**Step 3:** Add the plugin to plugins list:\n\n```diff\nmodule.exports = {\n  plugins: [\n+   require('postcss-multiple-themes'),\n    require('autoprefixer')\n  ]\n}\n```\n\n[official docs]: https://github.com/postcss/postcss#usage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaqi1520%2Fpostcss-multiple-themes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaqi1520%2Fpostcss-multiple-themes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaqi1520%2Fpostcss-multiple-themes/lists"}