Re: [community-group] [RFC] Format specification (#1)

👋 Hello everyone, I'm Nicolas, I've been working on some projects involving Design Tokens, and hope to do more, so I'm really interested in a standard for these.

I've read the whole thread two times to make sure I understand all opinions, and here are some comments:

# Syntax

I like @oscarotero's suggestion to use a CSS-like syntax, because it's really both "human-editable and human-readable", which is the first principle from @kaelig's [first message](https://github.com/design-tokens/community-group/issues/1#issue-459394632), it's better than JSON or YAML for some reasons @oscarotero listed [here](https://github.com/design-tokens/community-group/issues/1#issuecomment-663158695), and it already has many syntaxes and units for colors, dimensions, etc.

However, sadly, I think dev tooling to deal with such a format could probably not re-use CSS based tooling, as this syntax would be "inspired by" more than "based on" CSS. And there are already a lot of robust tools to deal with JSON or YAML inputs and outputs.

# Types

I agree that it would be best having types to help tools manipulate values, and allow for tokens files validation.

I use Style Dictionary and the CTI logic (or map it from my own hierarchy) to get typing, which allows for targeted transformations (px to rem, colors, etc.).

I see that @oscarotero said that "CSS has not typings and in most of cases it's not necessary", but I think CSS do have (infered?) typings, we can't put a dimension in a `background-color` property. Oh, but I said just above that CSS is not the best inspiration anyway… 😅

# Naming

I would prefer it to be restricted, even without dashes (but underscores could be used), to prevent any issue, as suggested by @lukasoppermann in [this comment](https://github.com/design-tokens/community-group/issues/1#issuecomment-701942523)

# Aliasing

As most of you already said, aliasing is a must have to deal with token reuse. Tools can deal with circular references and alert the user when there's something wrong.

# Property naming specification

From @lukasoppermann's [comment here](https://github.com/design-tokens/community-group/issues/1#issuecomment-696020851), I don't understand "are we talking about `border-color` or `stroke-color`". These are either tokens names or properties in the app, which values can be based on tokens. Why would this standard need to define these names?


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


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

Received on Thursday, 11 March 2021 19:06:40 UTC