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

Improve typing #7

Open
peduarte opened this issue Sep 11, 2020 · 3 comments
Open

Improve typing #7

peduarte opened this issue Sep 11, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@peduarte
Copy link

It would be great if utils could be typed against the tokens.

Currently, it only displays the valid CSS Properties:

image

We have an issue opened in Stitches about improving this (stitchesjs/stitches#129), so we may need to wait. But something to keep in mind

@braposo
Copy link
Contributor

braposo commented Sep 11, 2020

hey @peduarte I wasn't 100% sure about the typing but this seems to be related to the way the util is being used in stitches.

If you check this playground you'll see that the tokens come back correctly as suggestions but that doesn't seem to propagate when is used in the react package.

I've tried using a more complex typing by using ICssPropToToken which will actually give us the correct token scale based on the properties used in the utils. This is to make it more flexible as composeUtil can be used to compose any property.

Do you know why is this not picking up the correct types? In theory this should work but could it be something with the way the config is injected in that function?

@peduarte
Copy link
Author

@braposo im not sure, would need to dig.

@christianalfoni any pointers? 😄

@braposo
Copy link
Contributor

braposo commented Sep 11, 2020

thanks for that @peduarte! My gut feeling is that the config is being passed as any and that breaks the typing of ICssPropToToken as far as I can see. This playground has the config as any and you can see that there aren't any token suggestions now.

Hopefully @christianalfoni can help with that as well!

@hauptrolle hauptrolle added the enhancement New feature or request label Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants