An example CSS codemod built with PostCSS and a few other packages.
Read the full blog post and tutorial for creating CSS codemods with PostCSS.
- Clone the repository and change into the directory
- Install dependencies:
yarn install
- Run the transform:
yarn transform
- The CSS files in
src
(a.css
andb.css
) should have theircolor
properties set tored
(the transform)
This demo can be extended to solve a wide variety of CSS codemod needs. The PostCSS plugin can be updated to make any desired transform to the underlying CSS nodes.