Skip to content
This repository has been archived by the owner on Dec 26, 2023. It is now read-only.

Desired behaviour when changing theme tokens? #18

Open
sinclairnick opened this issue Mar 13, 2023 · 0 comments
Open

Desired behaviour when changing theme tokens? #18

sinclairnick opened this issue Mar 13, 2023 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@sinclairnick
Copy link
Owner

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 $.

Not 100% certain on best approach yet.

@sinclairnick sinclairnick added enhancement New feature or request question Further information is requested labels Mar 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant