RFC - Design Tokens Structuring #882
Replies: 3 comments 2 replies
-
I would focus on the fact that is not future-proof and it's not flexible enough for developers. Theming at least for me continues to be a nice-to-have, since - even in the long-term - I don't foresee this being necessary.
Separating concerns would only prevent breaking changes, no? In what way would breaking changes have a bigger impact?
What do you mean by raw token values? |
Beta Was this translation helpful? Give feedback.
-
How do you think we should handle the CSS variables? With Sass + Postcss? Or with some other tools like a style-dictionary: https://amzn.github.io/style-dictionary/#/README ? |
Beta Was this translation helpful? Give feedback.
-
We implemented this on the styling framework. |
Beta Was this translation helpful? Give feedback.
-
RFC Design Tokens Structuring
Problem
We overcomplicated the implementation of our current tokens, we currently use css variables, but they are not visible to the design system users (developers). They are built in runtime, which hinders performance and makes them inaccessible in css form for developers while coding. Having the raw variables unavailable for developers forces them to use our current style framework to have access to our design tokens and theming, instead of having the possibility of using any styling method they prefer. This attachment between style framework and tokens also makes it very difficult for us to change between different libraries and frameworks when we need it.
Why this matters?
Theming is an important theme (ha) when discussing a design system that serves an admin used by different companies with their own brands. Our current solution doesn't easily support the generation and usage of different themes. It is also not future-proof as it doesn't offer flexibility for developers or for our own future changes.
Proposal
Summary
Transform all design tokens into CSS variables that are exported and can be used by developers directly. Use these variables to build token integrated js styling solutions, instead of implementing tokens and js styling solutions together.
Current model
Proposed model
Details
We'll have a package exclusively for tokens. It will have scss files with the definition of css variable that will be exported for use.
Css in js helpers might be implemented and may use the tokens, but will not be defined in the same package, and they will not be a dependency for the token package.
Pros
Cons
Unresolved questions
What's next
Do you know if there are any follow-ups? (It can also be another RFC)
Beta Was this translation helpful? Give feedback.
All reactions