kevinlang / phx_gen_tailwind

Mix task to add Tailwind CSS to a new Phoenix 1.6+ project
Apache License 2.0
66 stars 5 forks source link

Unable to inject Tailwindcss imports into app.css #4

Closed APB9785 closed 3 years ago

APB9785 commented 3 years ago

When running phx.gen.tailwind with a regular app.css (no changes made from the 1.6 defaults), I get the notice

Unable to inject Tailwindcss imports into app.css

Everything else goes flawlessly, but I have to manually paste the imports in before installing NPM dependencies.

APB9785 commented 3 years ago

I'm thinking maybe it has something to do with the lack of phoenix.css - if the generator is using the presence of that import to check the necessity of injection, then it will miss the case where phoenix.css was already deleted and the import removed, but the tailwind imports still need to be added.

kevinlang commented 3 years ago

Thanks for the report. What command did you use to generate the initial Phoenix app? Did you delete phoenix.css manually before running phx.gen.tailwind?

APB9785 commented 3 years ago

I used https://phx.new to generate a sample 1.6 project, took the app.css from the sample project and copy/pasted it into an existing project, which I am upgrading from 1.5 to 1.6. The phoenix.css got deleted long ago.

kevinlang commented 3 years ago

I think I fixed it in v0.1.2-rc.0 which I just pushed, and added some tests too. If anyone encounters this again in future, feel free to ping me or open a new issue