-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Add support for aliases / tokens (all components) #33525
Comments
Interesting, so far we only see the need of applying integers there. Have you thought of maybe adding additional tokens in the theme that can basically contain these values, like:
Or simply using const for this, maybe something like:
This is a good example of how people may want to extend the style function used for the |
@mnajdova thank you for your response. Of course I didn't think of the simple solution 😵💫 |
I don't feel like this is efficient. Having to add more imports for constants sounds like bad practice. Having a place to define tokens and then use them as |
You can add additional tokens in the theme, that’s the first example in the comment above. Is it not sufficient? |
It solves the problem but feels odd having to call up Would be great if we could do this:
|
Duplicates
Latest version
Summary 💡
When implementing the theme from a design system, components, spacing etc are often described with tokes like
M
,XL
... etc.It would be great, if there would be an easy way to add a token / alias to a component, for example the typography h3 with
M
, or use spacing tokens instead of numeric values.My current workaround for headlines would be to add additional variants for the according headlines.
For spacing, I tried to solve this with a custom spacing function that is able to resolve the tokens, but unfortunately the custom spacing function is only called, when a numeric value is set to a css property like padding or margin
Examples 🌈
it would be great to do something like this
Motivation 🔦
I'm currently implementing a design system in MUI. Being able to define and use tokens would be great.
The text was updated successfully, but these errors were encountered: