Re: [community-group] Group & file level properties (#72)

I'd suggest that properties specified on a group *for tokens within that group to inherit* should be specified in a different way than *properties that apply to the group itself.*  Otherwise, there's ambiguity over which properties are inherited and which are not. (For example, is a group-level `description` inherited?)

My proposal would be something like:

```json
{
  "colorText": {
    "description": "Our palette of colors for text only.",
    "tokenProperties": {
      "type": "color"
    },
    "primary": {
      "value": "#000000",
      "description": "Use as the default text color"
    },
    "secondary": {
      "value": "#333333",
      "description": "Use for text that is not as important."
    }
  }
}
```

In this example, `colorText` is a group with only one property (a `description`), and all tokens within that group inherit a different property (`type: "color"`). This allows for groups to contain any number of properties of their own, along with any number of inherited properties.

<details>
<summary>Addendum: Avoiding name collisions</summary>
<br />What if a design system wants to use the same name for a token as for a group property? For example, imagine that the team wants to have a text color called <code>"description"</code>. An extension to accommodate this would be to allow group properties to be defined within a <code>properties</code> group. For example:<br />

```jsonc
{
  "colorText": {
    "properties": {
      "description": "Our palette of colors for text only.",
    },
    "tokenProperties": {
      "type": "color"
    },
    "description": {
      "description": "Use for descriptive text, including definition lists and footnotes.",
      "value": "#3f3f3f"
    }
    // other tokens...
  }
}
```

The token/group names `"properties"` and `"tokenProperties"` would be disallowed, but anything else would be valid.
</details>

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


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

Received on Monday, 27 September 2021 01:34:25 UTC