-
Notifications
You must be signed in to change notification settings - Fork 11
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
Token usages from within utils #8
Conversation
csantos1113
commented
Aug 4, 2021
•
edited
Loading
edited
- Fixes Token usages from within utils #7
- Organize Example layout
Co-authored-by: Fabian Finke <f.finke97@icloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your fixes and additions are looking good 👍🏻
I can think about the TS issue of theme a bit but we can definitely merge this as is and figure out a solution to the TS issue later since it's not a major issue.
We can drop the #6 right? This is build on top of it so all its changes are included.
Thanks for the contributions! 🙌🏻 Keep them coming 😉
Cool 👍🏻 I quickly researched the theme TS issue and found out this trick that might be used to keep the theme object as const so that we can extract the token name, eg with a utility type, and then get the real type for the token by using the name as key: type ExtractTokenName<T> = T extends `$${infer X}` ? X : never;
ExtractTokenName<'$foo'>; // --> 'foo' I couldn't get it to work yet so let's try to solve this later. |