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.
Using object syntax, you can see things like CSS's global colors:
Using x.div, color doesn't autocomplete at all.
Using css string literals, there's no guarantee. I don't expect anything here; writing CSS syntax almost doesn't seem worth it these days.
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?
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.
💬 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.
x.div
,color
doesn't autocomplete at all.css
string literals, there's no guarantee. I don't expect anything here; writing CSS syntax almost doesn't seem worth it these days.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?