Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leading/trailing white space in token names. #194

Open
romainmenke opened this issue Dec 7, 2022 · 0 comments · May be fixed by #216
Open

Leading/trailing white space in token names. #194

romainmenke opened this issue Dec 7, 2022 · 0 comments · May be fixed by #216

Comments

@romainmenke
Copy link
Contributor

romainmenke commented Dec 7, 2022

{
  "  foo  ": { "$type": "color", "$value": "#ff00ff" }
}

Token names are not defined in a similar way as ident tokens are in CSS, identifiers in JavaScipt, ...
There are no characters that indicate the start or end of a token name.

This implies that token names are defined by an "outside" boundary.
In the example above the token name is defined by the double quotes of the JSON string.

In this example the token name is defined by the enclosing curly braces :

{
  "bar": { "$value": "{  foo  }" }
}

These examples are a bit forced, but a lone trailing space is more common :

  • Brand Color Background Green -> remove Green -> Brand Color Background<trailing invisible space>
  • typo's

This in turn can be confusing for users of these tokens because the visible name doesn't match the actual name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants