Re: [community-group] High contrast colors (#91)

I've seen a few conversations where this shape of problem is bubbling up: authors shouldn't be prevented from using features of a platform (like CSS system color keywords) just because that feature does not exist in ALL platforms.

The more I think about it, the more I think @drwpow 's suggestion is the right path. (11 months ago lol)

If the author is writing tokens for a **single platform**, and thus no translation problems are likely. If the platform was CSS, a token might be defined like:
```json
{
  "color": {
    "highlight": {
      "$value": "Highlight",
      "$type": "constant"
    }
  }
}
```
The "constant" type would tell the translator to pass the value through unchanged. (maybe "preformatted" is a better word for this type? or "keyword"?).

If the author is writing tokens for **multiple platforms**, then we don't want to pass the value through unchanged, since `Highlight` is meaningless to anything but CSS. So we have to translate the value somehow. 

Using `Highlight` in CSS is saying "use whichever color the browser or user has stored as the value of the keyword `Highlight`." As we've discussed, not all platforms have this feature. If I'm trying to translate to a platform that doesn't support forced color modes, should the translator throw an error? Should it try to "coerce" this value into an equivalent? None of these seem like good solutions.

One possible route is to explore platform-specific token values, but that's a topic for another thread.

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


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

Received on Friday, 2 December 2022 17:37:12 UTC