Tailwind styling not possible with tailwind_actix example #3659
-
Hi guys, I am making my first steps with leptos and tailwind. I was able to create a website with csr leptos and tailwind and now I wanted to move to the ssr leptos actix tailwind website creation. I am following the steps for the tailwind_actix example. The project compiles, but somehow the styling is not applied, see screenshot. But it should look like this: https://tailwindcomponents.com/component/blue-buttons-example I am a bit stucked here because the out of the box example is not really working. If someone had the same issue, some help would be really appreciated. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Hm... I just tried the following: git clone https://github.com/leptos-rs/leptos
cd leptos/examples/tailwind_axum
cargo leptos watch (application compiles — I go to http://localhost:3000/) Application appears, styled correctly. I change a few classes in the editor — reloads with correct, updated classes. So, not sure what's happening with your setup here, unfortunately! Maybe more details would be helpful? Is the CSS file 404ing? Does it look like it's being generated correctly in the |
Beta Was this translation helpful? Give feedback.
Okey, I found the error:
In Tailwind CSS v4, the way you import and use Tailwind's utility classes has changed. The old @tailwind base;, @tailwind components;, and @tailwind utilities; directives are no longer used. Instead, you simply import Tailwind CSS with:
@import "tailwindcss";
in the tailwind.cssThis change is part of the updates in Tailwind CSS v4, which aims to make the framework feel more CSS-native and easier to use.