[RFC] Token in component scope support algorithm #43638
MadCcc
announced in
RFCs - archive
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Activation
Currently we provide ablilty to modify token in component scope like this:
In this way, we can customize token just within Button and will not affect other components.
As we all know, Design Token in global scope could be derived from Seed Token. For example,
colorPrimaryHover
will be derived fromcolorPrimary
, so we do not need to specify acolorPrimaryHover
, Button with customcolorPriamry
will have right hover style.However, tokens in component scope do not support this feature, which makes it hard to customize theme within components. So we decided to expand
theme
ofConfigProvider
to support this.API
theme
prop ofConfigProvider
AliasToken
(token: SeedToken) => MapToken
|((token: SeedToken) => MapToken)[]
defaultAlgorithm
OverrideToken
✅ Plan A: Remain current type
Keeping current type may cause breaking change. And we still need somewhere to config
algorithm
.When
algorithm
is a truthy value, we enable token calculation.Plan B: Extra Configuration
This may couse confusion about with token will work.
Basic Example
How we teach this
This change will be mentioned in changelog, and docs should be updated.
We should also provide more examples about customizing theme of antd, which will bring more confidence for user.
Adoption
Implement in
feature
branch.Beta Was this translation helpful? Give feedback.
All reactions