-
-
Notifications
You must be signed in to change notification settings - Fork 50.1k
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
feat: static getDesignToken #42723
feat: static getDesignToken #42723
Conversation
Pull reviewers statsStats of the last 30 days for ant-design:
|
import seedToken from './themes/seed'; | ||
import formatToken from './util/alias'; | ||
|
||
const getDesignToken = (config?: ThemeConfig): AliasToken => { |
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.
先出 RFC?
size-limit report 📦
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## feature #42723 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 640 645 +5
Lines 10892 10926 +34
Branches 2957 2967 +10
=========================================
+ Hits 10892 10926 +34
☔ View full report in Codecov by Sentry. |
大了200b |
@@ -28,4 +29,5 @@ export default { | |||
defaultAlgorithm, | |||
darkAlgorithm, | |||
compactAlgorithm, | |||
getDesignToken, |
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.
要不要在 components/index.ts
里面也导出一下?
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
getDesignToken
to access full Design Token.getDesignToken
用于获取完整的主题 token。☑️ Self-Check before Merge
🚀 Summary
🤖 Generated by Copilot at de2e4c8
This pull request adds a new function
getDesignToken
to thetheme
module, which allows users to access the design token object based on the theme configuration. It also adds type and test support for the function, and updates the documentation in both English and Chinese to reflect the new usage.🔍 Walkthrough
🤖 Generated by Copilot at de2e4c8
getDesignToken
function to return design token object based on theme configuration (link, link)ThemeConfig
type fromconfig-provider
context module to use ingetDesignToken
function and test suite (link)getDesignToken
function using custom render function anduseToken
hook (link)theme
module to follow convention (link)theme
module in English and Chinese versions, replacingdefaultAlgorithm
anddefaultSeed
withgetDesignToken
function and adding example of usage withConfigProvider
component (link, link)