New utility to help migrate to V3 #352
ryangoree
started this conversation in
Show and tell
Replies: 1 comment
-
Nice work! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I made a utility package which converts your codebase from single
classname
/tw
functions to utility functions :)It was pretty rushed, but worked well for our codebase. If it helps you or if you have any feedback, I'd love to hear about it!
https://www.npmjs.com/package/twcn3
README:
twcn3
A cli utility for converting codebases upgrading from tailwindcss-classnames v2 to v3.
In tailwindcss-classnames v3, you're required to use new utility functions to compose your classes rather than a single
classname
ortw
function. Depending on the size of your codebase, this can be an incredibly time-consuming task.This utility does it with one command:
Options
--version
- Show version number--help
- Show help-t
,--types <path-to-types>
- The path to your built tailwindcss-classnames types file. Only required if you have custom classes.-d
,--dir <path-to-src>
- The path to the directory with the files to be converted.(default:
src
)-a
,--alias <function-name>
- The name used when importing the classnames function from your type file. (i.e.import tw from 'tailwindcss-classnames.ts'
) (default:tw
)Beta Was this translation helpful? Give feedback.
All reactions