[Fresh 2] tailwind-plugin does not recognize @apply utility classes
I am migrating from Fresh 1 to Fresh 2. Simply moving my stylesheet from
./static/styles.css to ./assets/style.css and importing it in client.ts crashes the vite dev server with the following excerpt.
And here is a minimal crop from my styles.css
7 Replies
Following the docs of Tailwind v4, adding
@reference "tailwindcss"; only leads to a module not found error.
Following this guide, replacing
@tailwind with @import "tailwindcss"; doesn't resolve the module 'tailwindcss' either.
Is there Fresh 2 deploy templates with @apply or @import "tailwindcss"; for reference?yes, when you create a new fresh project and pick the tailwind option in the wizard you get a new project that's set up correctly
I would want to avoid starting from scratch until I really have to, are these templates hosted in GitHub or JSR where I can take a look first?
I didn't say you should start from scratch. I just said that the template generated by
@fresh/init does all the things you're looking for.
The code for the template that's generated is all here https://github.com/denoland/fresh/blob/main/packages/init/src/init.ts