Skip to content

Leading/trailing white space in token names. #194

@romainmenke

Description

@romainmenke
{
  "  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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions