-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: tailwindcss v4 #25
base: main
Are you sure you want to change the base?
Conversation
Support tailwind 4
to inline imported css
* refactor: use native test runner, remove vite, use tsc * ci: use `zsh` to glob test files * ci: use `glob` package for older node versions that don't support glob patterns * ci: remove eslint9 workaround * style: fix linting issues * chore: update eslint config * chore: fix glob pattern on windows * ci: upgrade to node 22 * ci: update npm test command to use "npm test" instead of "npm t"
Status update cc: @zcf0508 There were (and still are) some issues making this plugin compatible with tailwindcss v4.
TODO
|
I was inspired to create the feature from https://github.com/hyoban/tailwindcss-classname-highlight/blob/main/src/index.ts#L78, and wish this is helpful for you to resolve the problem. For now, I think we can publish an alpha version for v4 users, as tailwind v4 has not been release. Or we can release two versions that one for v3 and one for v4 to prevent code coupling and enhance clarity. |
My current branch doesn't yet work with tailwindcss v4 because I couldn't yet figure out how to resolve the I think the approach taken in https://github.com/hyoban/tailwindcss-classname-highlight is pretty hacky as it just reads all css files and creates the tailwind context from them. There is no resolving of import statements and the tailwind internals and it also includes css files that may not be intended for tailwindcss. The same problem exists in the branch you created for #18. I got pretty deep into a rabbit hole trying to resolve this problem and I have posted my findings in my comment above. In the anouncement blog post, they wrote about integrating lighntingcss and automatically handle those problems. In their codebase as it is right now, they have not done this integration yet and they still rely on The plan is now to wait for tailwindcss v4 to be more mature and let them figure out the solution to this problem. Any additional effort I put into this right now will eventually be wasted time in the long run and this is not sustainable for me right now. What I can do prior to this, is to make the plugin work with v4 in a way that it no longer crashes. If you disable the sort-classes rule, or change the order to I have done a lot of preparation work in #26 for this. |
I created a feature request in lightningcss for synchronous custom resolvers: parcel-bundler/lightningcss#747 |
Continuation of #18
Add support for tailwindcss v4.