Replies: 2 comments
-
What about making using |
Beta Was this translation helpful? Give feedback.
-
I did some further digging into my assertion that the current implementation of the So it is actually fine the way it is. With that in mind I am closing this discussion. |
Beta Was this translation helpful? Give feedback.
-
Description
When I try to add semantic tokens based on my core/primitive tokens I am forced to group them based on color, gradient etc.
But the consensus these days in the design system community seems to be that semantic tokens should be describe based how they are used. So a grouping based on their type (like color) makes them harder to manage.
Problem Statement/Justification
For example, The way we use semantic tokens, is as way to translate the theme of a brand or product (defined as core/primitive tokens) into tokens that describe how they are used within the UI design.
Our semantic tokens are divided into two sets: General tokens and component specific tokens.
A general token is set up like:
{part of the layout}.{property of layout}.{light/dark mode}
and might look like `paFor example, The way we use semantic tokens, is as way to translate the theme of a brand or product (defined as core/primitive tokens) into tokens that describe how they are used within the UI design.Our semantic tokens are divided into two sets: General tokens and component specific tokens.
A general toge.sideMargin.onLight` .
A component specific token is set up like:
{component name}.{variant}.{style element}.{state (optional)}.{light/dark mode}}
and might look like:button.cta.borderColor.focused.onLight
,button.cta.borderColor.hovered.onDark
orbutton-cta-borderColor.active.onLight
.Right now the sematicTokens property witihn theme prevents me from defining those, because it only allows grouping based on token type.
Perhaps (for now) there is a way arround this, but to me the current implementation is too strict.
Proposed Solution or API
Allow this:
Note: my TS syntax might be wrong, please forgive me ;-).
Alternatives
No response
Additional Information
I am aware that currently the grouping by value type allows for syntax like this:
In which the fact that
green.400
can automatically be found in the colors group, and my proposed solution could maybe ruin this.What could be an option is to allow something like this:
Where the
true
enforces the use of fully qualified (spelled out) token names.Beta Was this translation helpful? Give feedback.
All reactions