Re: [community-group] Make whitespace invalid in token names (#216)

> I'd propose instead of standardizing on CSS idents in this case, we use the JSON spec...

+1 on this one. 

As far as generating and managing DTCG file by humans, simple rules for managing spaces has great value.

However, the token name is an identifier that has a far reaching significance for tooling. Unlike CSS <ident>, which targets one target system (CSS parsers), the token name for Design token act as an identifier not just within the JSON document that represents Token (or list of tokens), but via translation tool with other ecosystems as well (It could be a CSS variable, Class name, Attribute name, ...).

It would be great usability improvement, if a token name is still "identifiable uniquely" after it is translated. This goes a long way in developing reliable tooling and predictable behavior for references and aliases. Which in turn, makes human life easier when debugging design token related issues in target implementation.

Proposoal,

Following is modified CSS <ident> spec, after dropping support for escaped character.

- any [ASCII](https://developer.mozilla.org/en-US/docs/Glossary/ASCII) character in the ranges A-Z and a-z
- any decimal digit (0 to 9)
- a hyphen (-)
- an underscore (_)
- any other [Unicode](https://developer.mozilla.org/en-US/docs/Glossary/Unicode) character U+00A0 and higher (that is, any other non-ASCII Unicode character)


-- 
GitHub Notification of comment by d34dman
Please view or discuss this issue at https://github.com/design-tokens/community-group/pull/216#issuecomment-2974027469 using your GitHub account


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

Received on Sunday, 15 June 2025 15:04:03 UTC