Re: [community-group] Can groups be a property? (#122)

> As a designer, grouping design tokens is very meaningful and can vary from one design system to another, can be organized differently from one design tool to another.

Absolutely agree with this.
This issue does not question the value of grouping itself.

> Could you further clarify what you mean when stating that groups are meaningless for design tokens?

This is part of the spec :
https://design-tokens.github.io/community-group/format/#groups

> Groups are arbitrary and tools SHOULD NOT use them to infer the type or purpose of design tokens.

Groups are meaningless not for designers but for the tokens themselves in the current specification.

> How does it complicate the design of the file format?

A nested file format is more complicated that a flat format.

For example :

```json
{
    "token uno": {
        "$value": "token value 1"
    },
    "token group": {
        "token dos": {
            "$value": "token value 2"
        },
        "nested token group": {
            "token tres": {
                "$value": "token value 3"
            },
            "Token cuatro": {
                "$value": "token value 4"
            }
        }
    }
}
```

vs.

```json
{
    "token uno": {
        "$value": "token value 1"
    },
    "token dos": {
        "$value": "token value 2",
        "$group": "token group"
    },
    "token tres": {
        "$value": "token value 3",
        "$group": "token group.nested token group"
    },
    "Token cuatro": {
        "$value": "token value 4",
        "$group": "token group.nested token group"
    }
}
```

> How would adding a group property per token be more beneficial than grouping a set of tokens? If using a group property, how would you nest or group a group of tokens?

Currently a dot separator is used to make grouped values addressable.
The same can be used for groups.

> And I'd like to better understand what you mean by sugary things.

https://design-tokens.github.io/community-group/format/#type-0

> Otherwise, if any of the token's parent groups have a $type property, then the token's type is inherited from the closest parent group with a $type property.

This is syntax sugar. It only benefits manually writing a tokens file while complicating both generating and consuming a tokens file.


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


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

Received on Friday, 25 March 2022 19:54:46 UTC