- From: Drew Powers via GitHub <sysbot+gh@w3.org>
- Date: Fri, 12 Apr 2024 18:13:25 +0000
- To: public-design-tokens-log@w3.org
> I think the `$type` alias is to allow for parsers just to know to check an object and its properties. Otherwise how would it know to check for colors? It’d have to assume a token structure (like all colors are under top level `color` property). Well that’s just the thing though—parsers actually have to validate aliases currently. Aliases _have_ to be non-circular. And non-aliases have to be valid tokens. By just accepting an unvalid schema at face-value, the user will get errors with no clear action on how to fix it. So parsers actually _do_ have to scan the alias and know it’s referring to a color anyway, and there’s no way for them to avoid having that work (or they’d be bad, hard-to-use-tools). But I was more interested in exploring whether that’s **an error** to show to the user “fix this!” or if it just silently works > Also this issue emphasizes the need for a section of the docs on parsing, and expectations the spec has - to create some consistency between tooling. 💯! -- GitHub Notification of comment by drwpow Please view or discuss this issue at https://github.com/design-tokens/community-group/issues/236#issuecomment-2052241456 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 12 April 2024 18:13:26 UTC