madyankin / postcss-modules

PostCSS plugin to use CSS Modules everywhere
MIT License
1.59k stars 87 forks source link

Feature request: generate .js.flow file for each .css module #91

Open alexkrolick opened 5 years ago

alexkrolick commented 5 years ago

Feature request:

Extend the JSON generation to create a similar xyz.js.flow file that could be used to map xyz.css to a Flow type definition, so that style imports are typesafe

madyankin commented 5 years ago

Unfortunately I have no enough time for the project, so PR's are welcome!

axyz commented 4 years ago

@alexkrolick you can do it easily with a side effect in a custom getJSON function

example implementation for typescript types:

https://github.com/utilitycss/atomic/blob/master/src/postcss/atomic-css-modules.ts#L243

https://github.com/utilitycss/atomic/blob/master/src/action/generate-atom-typings.ts