Currently, when changing theme tokens, some properties like fontFamily or color which accept arbitrary strings, don't error or otherwise indicate a problem. Ideally we would be notified by TS when we are erroneously using a non-existent token.
On one hand we could narrow string-based options, but in some cases this leads to type-explosions, like border="1px solid green", where the combinatorial for template-literal explodes. A more parsimonious approach could be just to wrap token-able parts with a sort-of ValidateToken<T> type which verifies the type is valid, if it begins with a $.
Currently, when changing theme tokens, some properties like
fontFamily
orcolor
which accept arbitrary strings, don't error or otherwise indicate a problem. Ideally we would be notified by TS when we are erroneously using a non-existent token.On one hand we could narrow string-based options, but in some cases this leads to type-explosions, like
border="1px solid green"
, where the combinatorial for template-literal explodes. A more parsimonious approach could be just to wrap token-able parts with a sort-ofValidateToken<T>
type which verifies the type is valid, if it begins with a$
.Not 100% certain on best approach yet.