-
Notifications
You must be signed in to change notification settings - Fork 297
refactor(theme-generator): streamline token management #696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
commit: |
TDesign Component Site Preview CI Open |
11ded29
to
78990c1
Compare
0de7bf0
to
02fa73d
Compare
02fa73d
to
978e93f
Compare
ad5c1a0
to
f936239
Compare
bc40a28
to
45f0b13
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR significantly refactors the theme generator package to streamline token management and improve the overall architecture. The changes focus on consolidating theme handling, optimizing file structure, and enhancing maintainability.
- Refactored theme management system with centralized store and simplified API
- Consolidated CSS template formats and reorganized built-in theme structure
- Streamlined token management by removing manual mappings and using dynamic CSS matching
Reviewed Changes
Copilot reviewed 75 out of 112 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
packages/theme-generator/vue.config.js | Added Vue extension resolution and updated quote consistency |
packages/theme-generator/src/size-panel/index.vue | Updated imports and simplified token list handling with refresh mechanism |
packages/theme-generator/src/size-panel/components/SizeDisplay.vue | Simplified token display logic by removing hardcoded mappings |
packages/theme-generator/src/size-panel/components/SizeAdjust.vue | Streamlined size adjustment with dynamic token value retrieval |
packages/theme-generator/src/size-panel/built-in/size-map.js | Consolidated size token definitions and removed duplicate data structures |
packages/theme-generator/src/shadow-panel/index.vue | Updated theme handling and improved local option management |
packages/theme-generator/src/shadow-panel/components/ShadowEditor.vue | Enhanced color picker integration with format specification |
packages/theme-generator/src/shadow-panel/built-in/shadow-map.js | Moved shadow definitions from const.js with updated string quotes |
packages/theme-generator/src/radius-panel/index.vue | Improved radius token initialization and consolidated built-in mappings |
packages/theme-generator/src/radius-panel/built-in/radius-map.js | Unified radius token definitions in single file |
packages/theme-generator/src/panel-drawer/index.vue | Simplified drawer component with centralized theme store integration |
packages/theme-generator/src/font-panel/index.vue | Updated font panel with new component structure and token mapping |
packages/theme-generator/src/font-panel/components/LineHeightAdjust.vue | Enhanced line height adjustment with improved token handling |
packages/theme-generator/src/font-panel/components/FontSizeAdjust.vue | Streamlined font size adjustment logic and token management |
packages/theme-generator/src/font-panel/components/FontColorAdjust.vue | Updated color adjustment with new component imports |
packages/theme-generator/src/font-panel/built-in/font-map.js | Consolidated font-related token definitions |
packages/theme-generator/src/float-dock/index.vue | Updated dock component with centralized theme management |
packages/theme-generator/src/common/utils/index.js | Enhanced utility functions with theme mode detection and token value retrieval |
packages/theme-generator/src/common/themes/ | New centralized theme management system with store, core functions, and built-in themes |
packages/theme-generator/src/common/components/ | Consolidated common components with unified export structure |
packages/theme-generator/src/common/i18n/ | Reorganized internationalization with centralized exports |
packages/theme-generator/src/color-panel/index.vue | Complete rewrite of color panel with improved token management and theme integration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
🤔 这个 PR 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
Important
破坏性重构 -> 新增 CONTRIBUTING_zh-CN.md(架构文档)
应该要升大版本号 ->
v1.2.0
简化内置主题的 CSS 模板格式,由原先的 common 文件下还区分了 font/radius/size,改为将其合并为 一个
extra.css
,和腾讯云的格式统一,未来如果有新增主题,可以参考该格式修复多处显示的 value 和实际数值不统一的情况
整理文件夹和代码变量结构,尽可能让文件夹名统一,禁止在不同的 panel 文件夹下,常量的位置一会在
const.js
, 一会在built-in/xxx-map.js
,移除大量依赖手动维护的 Token Map,尽可能从 CSS 动态匹配同步 ColorPicker 使用 TDesign Vue 的内置组件,而不是内部自己封装
修复部分变量本地持久化异常,优化折叠组件卡顿,引入全局的 Theme Store 等
📝 更新日志
☑️ 请求合并前的自查清单