-
Notifications
You must be signed in to change notification settings - Fork 63
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
Token name can be an empty string #195
Comments
Interesting! It's funny that JSON allows for this. My feeling is that token names have to be non-zero. I can't imagine a use case for a token called "" ... but open to possibilities if we can think of them. |
I agree. This is allowed in today's specification text, but is really awkward. {
"": {
"": {
"": {
"": { "$value": "3rem" }
}
}
}
} Token |
I found this useful for stepped tokens where the middle value represents what people think of as the color:
Which can be transformed into:
|
@srouse That looks like a bug in your translation tool :/ I don't understand why it would convert this to It does illustrate why it is important for the specification to be explicit about allowing this or not. It is an edge case that should not be overlooked by implementers. |
Related to #200 |
The current specification does not require token names to be strings with a non-zero length.
https://tr.designtokens.org/format/#name-and-value
This parses just fine :
Is this intended?
The text was updated successfully, but these errors were encountered: