[community-group] Should the spec include more semantic types? (#104)

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

== Should the spec include more semantic types? ==
It is useful to have more semantic information about a token and how it is to be used, especially when displaying previews of tokens or limiting which tokens are available to use. 

However, some of the current token types are missing this semantic information. A good example of this is the `dimension` type. It is being used for `fontSize`, `letterSpacing`, `borderRadius`, `width`, `padding`, `margin`, etc. 

Without knowing how a token is intended to be used, we are unable to display the correct token preview or limit where it is available. e.g. all `dimension` tokens would show up in a picker for a `borderRadius` property. 

I can see a few options for adding this information to a token:

1. Add more semantic types — I can only think of a few which would cover most needs. These could be added as aliases. e.g. `fontSize` type as an alias for `dimension`. 
2. Add an additional optional property on tokens specifically for this. e.g. `semanticType` or `usedFor`, but this feels overly complex
3. Add the semantic type in the token `extensions`. This is what we are doing at the moment, but removes some of the interoperability between different tools.

Is this something that has been considered? What is the suggested approach to handle this from a tooling perspective? 

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


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

Received on Friday, 14 January 2022 00:17:36 UTC