- From: Dura via GitHub <sysbot+gh@w3.org>
- Date: Mon, 05 Dec 2022 17:43:00 +0000
- To: public-design-tokens-log@w3.org
> Maybe best to open specific issues here for each. Afaik this specification is not intended to depend on `$extensions` for basic things.
Fair, but I'm not sure platform-specific things qualify as "basic"... at least not across the board. It kind of smells to me that an arbitrary update to iOS/Swift that Apple decides to make would/could require an update to the Tokens spec to support some new type or syntax in iOS 17? But, as you somewhat said, the "concept" of a keyword (or even more agnostic... the concept of an "unquoted string" type) may be universal enough to warrant placement in the spec?
> Do you have concrete examples? Are these for supported token types in this specification?
Tbf, I'm _mostly_ using `$extensions` to patch holes because the transformer I use (StyleDictionary) hasn't implemented the spec, yet...
```json
$extensions: {
deprecated: {
renamed: "new-token-name",
message: "@deprecated: Replace with 'new-token-name' token",
},
swift: {
available: {
platform: "iOS 13",
introduced: "4.0.0",
deprecated: "4.1.0",
obsoleted: "5.0.0",
unavailable: true,
},
optional: true,
type: "UInt",
},
tier: "option" | "intent" | "component" | "decision"
},
```
Most of the above values are used in some custom output formats I've created. For example, I have a custom Swift format that outputs some [`@available()` syntax](https://nshipster.com/available/) that provides helpful dev info in Xcode.
The `swift.type: "UInt"` property basically forces it to be a `UInt`, instead of the default `CGFloat` in the final Swift output.
However, the `tier` property could probably be handled by `Groups` as detailed in the spec, it's just Style Dictionary hasn't implemented that yet. (And, to be honest, even if they do, I may not want to author the Tokens that way, so the possibility to still want some custom metadata to exist is high)
--
GitHub Notification of comment by chris-dura
Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/177#issuecomment-1337830565 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 5 December 2022 17:43:02 UTC