Typed reshadow classnames
Hi, it would be cool to have option to generate typings for reshadow css files using this module https://github.com/Quramy/typed-css-modules. it will improve development experience and will reduce problem with missing classnames in you r code. I don't have concrete proposal for that but the best case would be.
- typed classnames/components for css files
- typed classnames/components for inline css
- typed props resolved from css Although 2 and 3 seems to be quite hard to implement, 1 case should be low hanging fruit though. I'd add such option to babel plugin or as external tool, I'm not sure at this moment. I'd be happy to hear your comments on this
Hi, thank you for the issue.
-
I believe the plugin you suggested should work out of the box with reshadow if you do happen to use classnames (probably for 3rd party libs). Reshadow takes away the manual labor of mapping styles to components. This advantage makes this plugin rather irrelevant. But in theory should work w/ reshadow if you still in a situation where you need class names.
-
As for inline css I am not sure how a plugin would work. Since atm you can only get access to the styles through
styled.styles.myCustomClassNameapi which is not exactly documented nor suggested. Sure we can makestyleda generic type but it comes with other trade offs.
Generally on this topic there is a good discussion about ts support in #40
TS is still an open topic for reshadow which we hope to document and solve some of the caveats reshadow has atm.
- yes, but I would like to see typed components
- Idk, but I guess it's possible to extract component names from js code