Re: [community-group] Clarify if manually typing and reading token files is a primary concern (#149)

Is it possible to provide and explore more examples?

The specific case of type inheritance wasn't problematic at all.
To add support for this in my current implementation I had to write 4 lines of code.
It didn't really complicate anything and I agree that it is a useful feature for human editing.

------

More relevant examples:
- parsing dimensions : `"-34534.231225e-23px"`
- structured color syntax : `{ "colorSpace": "srgb", "channels": [0.1, 0.2, 0.3], "alpha": 0.5 }`

Currently it is a bit arbitrary which data has a micro syntax and which data is structured.

https://tr.designtokens.org/format/#border

Borders are largely structured but contain micro syntaxes :

```json
{
  "border": {
    "heavy": {
      "$type": "border",
      "$value": {
        "color": "#36363600",
        "width": "3px",
        "style": "solid"
      }
    }
  }
}
```

Could be :

```json
{
  "border": {
    "heavy": {
      "$type": "border",
      "$value": "#36363600 3px solid"
    }
  }
}
```

Or :

```json
{
  "border": {
    "heavy": {
      "$type": "border",
      "$value": {
        "color": {
          "colorSpace": "srgb",
          "channels": [0.212, 0.212, 0.212],
          "alpha": 0
        },
        "width": {
          "value": 3,
          "unit": "3px"
        },
        "style": "solid"
      }
    }
  }
}
```

--------

> We also understand the specification has to lead to token files that are parsable and portable. If part of the specification is vague, it can introduce errors in portability, and we will take steps to update the spec when those areas are identified.
Unfortunately there’s not a decision tree or a concrete mechanism we can use to apply this principle to each decision, since context informs us on a case-by-case basis. To help illustrate this principle in practice here’s an example where we feel this principle has informed our decision making process:

I think the minimum requirement is detailed parsing steps in the specification.

Other things that can help :
- reference implementations in a widely used programming language.
- token files with more exotic contents to be used in tests by implementations


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


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

Received on Thursday, 8 December 2022 20:53:12 UTC