postcss / postcss-js

PostCSS for React Inline Styles, Free Style and other CSS-in-JS
MIT License
657 stars 25 forks source link

Preserve case of sass :export-ed variables when objectifying #70

Closed zewish closed 1 year ago

zewish commented 1 year ago

We're currently using a Vite plugin (vite-plugin-sass-dts) to generate .d.ts files from .module.scss in our project. This tool uses the objectify() function internally to generate the class names list before exporting them to type definitions. Unfortunately our ":export { caseSensitiveVariable: 1px }" gets objectified to the following object:

{
  ":export": {
    "casesensitivevariable": "1px"
  }
}

I used patch-package to run this on our side and it seems to fix the issue. For me this seems the easiest place to fix this since, I'm pretty sure other tools dependent on this package might also need this issue fixed.

ai commented 1 year ago

Sure. Let’s add it.

ai commented 1 year ago

Released in 4.0.1.