solid-start icon indicating copy to clipboard operation
solid-start copied to clipboard

CSS-Modules and typescript-types

Open benbender opened this issue 3 years ago • 3 comments

Because I just saw https://github.com/solidjs/solid-docs-next/pull/114/files, I asked myself if solid-start should ship a solution for generating typings for css-modules.

ATM, if you use css-modules and do smth like import styles from 'Component.module.css', styles will be of type any. I think it should be typed if css-modules are advertised as "supported".

This could be done using something like https://github.com/activeguild/typescript-plugin-css-modules-vite. Note: There are several plugins out there and I did not have evaluated them.

benbender avatar Jul 21 '22 19:07 benbender

This is a fair point and we should definitely try to do something about it, I wonder how typesafe we can make it.. there are levels .. do we want all classes exactly ?

nksaraf avatar Jul 23 '22 03:07 nksaraf

Basically yes - at least until https://github.com/solidjs/solid/issues/1041 is solved :)

benbender avatar Jul 23 '22 04:07 benbender

fwiw I'm using typed-css-modules

It works quite well, but you have to deal with extra .d.ts files everywhere. Would be nice if there was a solution that "just worked" both during dev and for CI without those extra files.

deluksic avatar Jan 07 '23 19:01 deluksic