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

Issue with latest tailwind (4.0.8) - styles disappear / not generated by tailwind #603

Open
andrienko opened this issue Feb 22, 2025 · 5 comments
Labels
needs triage needs to be reviewed

Comments

@andrienko
Copy link

andrienko commented Feb 22, 2025

The issue

I am using tw4 in my vite project, with vite plugin. In the project itself it works as expected. In ladle it used to work before, but all of a sudden it stopped (still works in main app tho) after I updated my deps - tailwind just does not generate the styles needed by components, but generates ones used by ladle (added via .ladle/components.tsx.

There is nothing specific about ladle's config, it uses the same configs and roughly same styles as the main app.

Not sure if it is a ladle issue - or rather a tailwind issue, but as main app works and ladle doesn't - I suppose there is something specific either with ladle or how I am using it.

Workaround

Reverting tailwindcss and @tailwindcss/vite from 4.0.8 back to 4.0.6 and locking versions helps.

Reproduction

Was unable to start it in stackblitz (as tailwind apparently needs a native extensions, and they are forbidden in stackblitz)

Therefore I created a repo: https://github.com/andrienko/ladle-issue-reproduction

(it is a stripped down version of my setup, with all important stuff remaining, in case something is wrong with my setup)

Environment

Reproduces on windows 11 / macos ventura / arch 2025.02.01, and in latest chrome/firefox.
Doubt the environment is relevant

@andrienko andrienko added the needs triage needs to be reviewed label Feb 22, 2025
@andrienko andrienko changed the title Issue with latest tainwind (4.0.8) Issue with latest tailwind (4.0.8) - styles disappear / not generated by tailwind Feb 22, 2025
@nourjandali
Copy link

@tajo Same issue here. Can we please fix this asap? It's an important issue.

@sporto
Copy link

sporto commented Mar 3, 2025

Same

@g-sam7
Copy link

g-sam7 commented Mar 6, 2025

Seeing this as well. Reverting to 4.0.6 did not resolve this for me.

@Walqer
Copy link

Walqer commented Mar 20, 2025

Have the same problem. Can anyone help?

@korpeev
Copy link

korpeev commented Mar 23, 2025

I found a temporary solution. You need to create a css file inside .ladle and import tailwind

example @import 'tailwindcss' source(path to components);

don't forget to import index.css into ./ladle/components.tsx

UPD:

enough to specify in source (path of folders where your components are located) when importing tailwind

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage needs to be reviewed
Projects
None yet
Development

No branches or pull requests

6 participants