js-css-migration
v2.0.0
Published
styled components to css modules migration helper for next.js / react projects
Downloads
24
Readme
js-css-migration
🎨 Migrate your project from Styled Components to CSS Modules.
Features
- Changes all styles.js files to styles.module.css.
- Creates a custom class inside styles.module.css for each Styled Component.
- Refactors the component's return statement with appropriate class names and HTML elements.
- Removes Styled Component imports and transfers any necessary import statements to the index.js file.
Before You Install
To be able to use command line,
you can either download the package globally or you can add the following command to your package.json file:
"scripts": {
...
"migrate": "js-css-migration migrate"
},
Installation
Global Installation
$ npm i js-css-migration -g
$ yarn global add js-css-migration
Normal Installation
$ npm i js-css-migration
$ yarn install js-css-migration
Basic usage
To migrate a specific folder path such as: /src/components/common
$ js-css-migration migrate <folder_path>
To migrate all components under the directory: /src/components/
$ js-css-migration migrate
If you added a script instead of downloading globally, you can use it like this:
$ npm migrate
$ yarn migrate <folder_path>
Documentation
Upcoming.