styled-components / xstyled

A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
https://xstyled.dev
MIT License
2.28k stars 105 forks source link

Type-safety and autocomplete? #266

Closed pstoica closed 3 years ago

pstoica commented 3 years ago

💬 Questions and Help

I can't use v3 in production yet due to some recently reported issues, but I had a question about Typescript usage. The types overall seem too flexible to guarantee that you're using existing tokens. I understand falling back to CSS, but it makes it harder to guarantee consistency and correctness.

I really appreciate the work and it certainly makes styled-components easier to use. In the long-term, however, I'm starting to consider options like stitches.dev since it seems hard to guarantee type-safety and DX in an automagic fashion. I guess I'm wondering if it's worth overriding the types or if there's anything else in the roadmap to solve these issues?

gregberge commented 3 years ago

Hello @pstoica, xstyled is flexible by nature and fallback to CSS. If you need something more strict, then it is probably not the good solution for you.