Re: [community-group] Optional "tags" property on tokens (#109)

I like the idea of a tags property (in light of the recent [decision to prefix format properties with `$`](https://github.com/design-tokens/community-group/issues/61#issuecomment-1021459887), it would need to be `$tags` though).

Just to make sure I've understood the original intent correctly, I'm assuming that `$tags` would be a means of tagging tokens with keywords (similar to how you might tag a blog post). Presumably tools could use that in a variety of ways:

* Filtering / searching for tokens could by done by tags
* If teams also tag components or other parts of their design system, it could provide a means of associating those things with related tokens. A design system website might then use that to generate links between pages documenting components, tokens, etc.
* I'm sure folks will come up with other cool uses ;-)

@WardMe is that a fair summary of how you'd envisaged `$tags` being used? If not, then please do correct me.

My next question then would be: Should the `$tags` only be allowed on tokens, or on groups as well? And, if it is allowed on groups, does it apply to the group itself (i.e. you're tagging a group, not things within the group) _or_ is it inherited by tokens within that group (just like `$type`, when applied to a group)?

I can imagine the latter being useful. It would basically be a handy way to apply the same set of tags to several tokens at once. However, given that the value of `$tags` is an array, what should the behaviour be for when a token that is inherting `$tags` from a parent group also has its own `$tags` property. Do the token's tags _replace_ the inherited ones, or do they get merged?

```jsonc
{
  "color": {
    "brand": {
      // Tags on the "brand" group, which are inherited by
      // tokens within this group
      "$tags": ["global", "marketing", "company"],      

      "primary": {
        "400": {
          "$value": "#7cf88b",
          "$type": "color",
          // Tags on the "400" token
          "$tags": ["green", "logo"]

          // Are the resolved tags for this token:
          // a) ["green", "logo"] (replaced)
          // b) ["green", "logo", "global", "marketing", "company"] (merged)
        }
      }
    }
  }
} 
```

I'm thinking merged would be more useful. What do you think?



-- 
GitHub Notification of comment by c1rrus
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/109#issuecomment-1027367202 using your GitHub account


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

Received on Tuesday, 1 February 2022 22:55:37 UTC