clinyong / vscode-css-modules

https://marketplace.visualstudio.com/items?itemName=clinyong.vscode-css-modules
MIT License
143 stars 39 forks source link

Typescript support #81

Closed alexey-koran closed 1 year ago

alexey-koran commented 1 year ago

Why did you remove support for .ts files?

TheSwilliam commented 1 year ago

We no longer have intellisense using styles in .ts files. Can you please add the support back in.

iChenLei commented 1 year ago

Why you using css modules in .ts files ? Any showcase for maintainers to understand your usage? Thanks

TheSwilliam commented 1 year ago

the example is that we have an interface that defines style themes for a library. I then have to create a myTheme.ts file to map my classes to the theme names.

mytheme.module.css

.myBackground{
    background: red;
}

typescript theme interface

interface ITheme{
    backgroundTheme:string;
}

usage in MyTheme.ts

import styles from './mytheme.module.css'
const  myTheme: ITheme = {
    backgroundTheme: styles.myBackground;
}