{"id":13805174,"url":"https://github.com/letshare/storybook-addon-customize-antd-theme","last_synced_at":"2026-02-25T22:08:11.268Z","repository":{"id":57371448,"uuid":"409821361","full_name":"letshare/storybook-addon-customize-antd-theme","owner":"letshare","description":"a Storybook addon help you visually customize an ant design theme","archived":false,"fork":false,"pushed_at":"2023-10-10T06:46:05.000Z","size":4454,"stargazers_count":32,"open_issues_count":4,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-02T11:47:18.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/letshare.png","metadata":{"files":{"readme":"README-zh_CN.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}},"created_at":"2021-09-24T03:38:17.000Z","updated_at":"2024-12-31T07:28:50.000Z","dependencies_parsed_at":"2024-01-22T04:48:55.848Z","dependency_job_id":null,"html_url":"https://github.com/letshare/storybook-addon-customize-antd-theme","commit_stats":{"total_commits":40,"total_committers":3,"mean_commits":"13.333333333333334","dds":0.09999999999999998,"last_synced_commit":"61c04c063c308bf97e99d4e6800ec1ed4cfaec22"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/letshare/storybook-addon-customize-antd-theme","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letshare%2Fstorybook-addon-customize-antd-theme","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letshare%2Fstorybook-addon-customize-antd-theme/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letshare%2Fstorybook-addon-customize-antd-theme/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letshare%2Fstorybook-addon-customize-antd-theme/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/letshare","download_url":"https://codeload.github.com/letshare/storybook-addon-customize-antd-theme/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/letshare%2Fstorybook-addon-customize-antd-theme/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29843036,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T21:18:31.832Z","status":"ssl_error","status_checked_at":"2026-02-25T21:18:29.265Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":[],"created_at":"2024-08-04T01:00:58.266Z","updated_at":"2026-02-25T22:08:11.252Z","avatar_url":"https://github.com/letshare.png","language":"TypeScript","funding_links":[],"categories":["Theming"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n[![npm version](https://badge.fury.io/js/storybook-addon-customize-antd-theme.svg)](https://badge.fury.io/js/storybook-addon-customize-antd-theme)\n[![GitHub license](https://img.shields.io/github/license/letshare/storybook-addon-customize-antd-theme.svg)](https://github.com/letshare/storybook-addon-customize-antd-theme/blob/master/LICENSE)\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n\n\u003c/div\u003e\n\n\u003chr/\u003e\n\n## storybook-addon-customize-antd-theme\n\n一个[Storybook](https://github.com/storybooks/storybook)插件， 它可以辅助你可视化定制 ant design 主题。\n\n- [Docs \u0026 Demo](https://letshare.github.io/storybook-addon-customize-antd-theme)\n\n[English](./README.md) | 简体中文\n\n## 要求\n\n- Storybook@\u003e=6.0.0\n\n## 使用\n\n### 1. 安装\n\n```sh\nnpm install -D storybook-addon-customize-antd-theme\n# yarn add -D storybook-addon-customize-antd-theme\n```\n\n### 2. 在 `main.js` 注册本插件\n\n另外建议导入本插件的一个 antd story`storybook-addon-customize-antd-theme/dist/esm/stories/index.js`\n\n```js\nmodule.exports = {\n  stories: ['storybook-addon-customize-antd-theme/dist/esm/stories/index.js'],\n  addons: ['storybook-addon-customize-antd-theme'],\n};\n```\n\n### 3. 设置 story 的默认状态\n\n你可以在 preview.js 初始化导入一个 ant design 主题，在`parameters`上设置属性`customizeAntdTheme`：\n\n```js\n// .storybook/preview.js\n\nexport const parameters = {\n  customizeAntdTheme: {\n    modifyVars: {\n      'primary-color': '#ff1771',\n      'border-radius-base': '20px',\n    },\n  },\n};\n```\n\n`modifyVars` 也可以是 less string，可以通过 webpack 插件`raw-loader`导入一个 antd design 主题 less 文件，例如：\n\n```js\n// .storybook/preview.js\nimport themeLess from '!!raw-loader!../src/theme/theme.less';\nexport const parameters = {\n  customizeAntdTheme: {\n    modifyVars: themeLess,\n  },\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletshare%2Fstorybook-addon-customize-antd-theme","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletshare%2Fstorybook-addon-customize-antd-theme","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletshare%2Fstorybook-addon-customize-antd-theme/lists"}