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

Token usages from within utils #8

Merged
merged 10 commits into from
Aug 5, 2021
Merged

Conversation

csantos1113
Copy link
Contributor

@csantos1113 csantos1113 commented Aug 4, 2021

IMG_7394

Copy link
Owner

@Temzasse Temzasse left a 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 😉

@csantos1113
Copy link
Contributor Author

@Temzasse excellent. I cleaned this PR up. Yes, initially I built it on top just to reuse the Example layout organization. but this should be ready to go (I took out all useTheme related code). I'll deal with the conflicts in #6 afterwards

@Temzasse
Copy link
Owner

Temzasse commented Aug 5, 2021

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.

@Temzasse Temzasse merged commit 97042f7 into Temzasse:main Aug 5, 2021
@csantos1113 csantos1113 deleted the utils-tokens branch August 5, 2021 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Token usages from within utils
3 participants