Skip to content
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

[Feature request] Support Tailwind 4 #325

Open
aslakhellesoy opened this issue Mar 15, 2024 · 3 comments
Open

[Feature request] Support Tailwind 4 #325

aslakhellesoy opened this issue Mar 15, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@aslakhellesoy
Copy link

Is your feature request related to a problem? Please describe.

TailwindCSS 4 is in alpha and will be released soon. Currently I cannot use this module with Tailwind 4 because package.json specifies ^3.4.0.

Describe the solution you'd like

A new release that supports both ^3 and ^4.

Describe alternatives you've considered

I tried updating tailwindcss to 4.0.0-alpha.9 in peerDependencies and devDependencies, but npm install failed because of other dependencies:

  • @tailwindcss/aspect-ratio
  • @tailwindcss/forms
  • @tailwindcss/line-clamp
  • @tailwindcss/typography

These all depend on tailwindcss version ^3.

I'm not sure when/if those plugins will be updated for Tailwind 4.

Additional context

Will this need some help from the maintainers of the 4 modules above?

@aslakhellesoy aslakhellesoy added the enhancement New feature or request label Mar 15, 2024
@francoismassart
Copy link
Owner

Making the eslint-plugin-tailwindcss compatible with Tailwind CSS v4 won't be easy and it'll definitively take a lot of time. One of the main challenge will be to workaround the possible the absence of tailwind.config.js file.

Parsing of existing CSS file (containing the CSS vars) is also very slow compared to native config...

I'll work on it but keep in mind this project is free and I can only work on it on my free time 😉

@virtuallyunknown
Copy link

@francoismassart in their announcement post about v4, they mention that configuration would still be available with a tailwind.config.js file, and it's something on their roadmap.

Support for JavaScript configuration files — reintroducing compatibility with the classic tailwind.config.js file to make migrating to v4 easy.

https://tailwindcss.com/blog/tailwindcss-v4-alpha#roadmap-to-v4-0

So in case parsing CSS proves to be too difficult, inefficient or time-consuming, would you be open to the idea of having such file mandatory in order to use eslint-plugin-tailwindcss?

To be totally honest here, I am not completely sold on the idea of defining all colors and other variables in a CSS file to begin with, so who knows, I can see people that will prefer to stick with the good old config file, especially if config-less Tailwind breaks other tools such as this one.

The only worrying part here is that they mention they are doing this to make v4 migrations easy, which may or may not imply they plan to get rid of it altogether in some later version, but I could be wrong.

@francoismassart
Copy link
Owner

I started reading the next branch of Tailwind CSS's codebase and I'll work on it soon on my free time, I've a full time job to comply to 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants