-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support typed css-modules with typescript #35
Comments
Any ideas how can we implement this? |
@sobolevn AFAIK Nuxt doesn't provided builtin support for It's the webpack plugin/loader that should check vue files & which should warn you I don't think there is something to do around Nuxt core, unless I misunderstood something. |
Well, What webpack plugin are you talking about? It would be an awesome addition. |
Alright well I think https://github.com/seek-oss/css-modules-typescript-loader just allows you to be able to have auto completion and type checking in The If you want type safe css in templates, you'll need to use Vue |
@kevinmarrec I like your idea. Probably we can automate some operation over |
@pi0 You mean something like that ? : Shouldn't it better being the automation thing optional i.e. not activated by default and being activated through a |
Is there any new issue / repo to track the external module progress? |
@sobolevn No but I'd recommend that you or someone else create its own repository and can publish a package with a name like |
What problem does this feature solve?
Currently I have to do several things to support
css-modules
in my code:Source: https://github.com/wemake-services/wemake-vue-template/blob/master/template/client/shims/style.d.ts
webpack
configuration to work withtypings-for-css-modules-loader
orcss-modules-typescript-loader
And I think that it can be supported out-of-the box. It might fill in the gap between
typescript
andcss
.My motivation is quite simple: I do not want to have runtime problems with code like this:
Full source: https://github.com/wemake-services/wemake-vue-template/blob/master/template/client/components/ActionBar.vue
Is
$style.actions
in scope? What will happen when I rename.reload
or.actions
classes? What if I have a typo there?I use
typescript
to get rid of these kind of errors in my app. But now it works only with my logic (aka scripts). I also want my styles to be safe.Maybe a plugin will also work fine. Will be happy to write it if core support is not planned.
Next analog: https://github.com/forthedamn/next-typed-css
Cheers!
The text was updated successfully, but these errors were encountered: