[community-group] Optional token $type (#173)

honzatmn has just created a new issue for https://github.com/design-tokens/community-group:

== Optional token $type ==
Since we plan to extend our token format in Supernova, we're also checking Design Tokens Format Module specification and trying to figure out differences in what is defined in the format vs. how we work with tokens in Supernova. We'd like to eventually support also import based on DT Format, and I was surprised by the decision to have `$type` property for tokens and parent group as optional. Especially because the promise of `$type` in this specification is _[that tools can reliably interpret their value](https://design-tokens.github.io/community-group/format/#character-restrictions)_.

I found older discussions in #63 and #72, but it seems that it might result in situation where the token type is not defined at all. 
In that case, this applies:
> Otherwise, the token's type is whichever of the basic JSON types (string, number, boolean, object, array or null) its value is.



However, if the type is based on the basic JSON type, we often get just a `string`. In these cases, we'll need to _guess_  what is the type of the token based on the value. This is in direct conflict with another paragraph in the Types section:

> Tools MUST NOT attempt to guess the type of a token by inspecting the contents of its value.

So I'm a bit confused about how should vendors who implement the Design Tokens Format approach this.

Would the group please consider making the `$type` mandatory either for a token, or a group in which the token lives? It would really make it easier for vendors to implement the format reliably.

Thanks a lot for considering.



Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/173 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Sunday, 9 October 2022 18:09:21 UTC