parcel-plugin-typed-css-modules
parcel-plugin-typed-css-modules copied to clipboard
Runtime property names have hyphens, while d.ts is camel cased.
The following CSS:
#app-root { ... }
.widget { ... }
.ticker { ... }
.ticker .selected { ... }
.positive { ... }
.negative { ... }
generates the following d.ts with names camel cased:
export const appRoot: string;
export const widget: string;
export const ticker: string;
export const selected: string;
export const positive: string;
export const negative: string;
But during runtime, the hyphens remain and there is no camel cased alternative:

For that you need to update how parcel generates module class names. My .postcssrc file looks like this:
{
"modules": true,
"plugins": {
"autoprefixer": {
"grid": true
},
"postcss-modules": {
"generateScopedName": "[name]_[local]_[hash:base64:5]",
"camelCase": true
}
}
}
"camelCase": true this should be in the readme. Currently ended with my bug here and this sovled. Thanks
Thanks for the fix @bogdan-zaharia-hs I definitely agree, this should end up in the Readme!