Tailwind not picking up classes after upgrade to filament v4
I have recently upgraded to filament v4 and with that to tailwind v4, but where v3 used to pick up and include styles in my custom blade components, v4 doesn't seem to do that. For reference here is my configuration:
vite.config.js:
app.css
theme.css (for the panel):
Solution:Jump to solution
Okay, so I've fixed that too, I'm just leaving the solution here, if you are extending a filament page class and rendering that outside a panel, you have to add the @vite directive to the layout used by the pages (I did this by overwriting the base layout, there might be a better solution)
3 Replies
Now I have this issue in multiple places, once with a component that I'm trying to render on the admin panel using a render hook, but also on a custom livewire component, that isn't part of any panel but rendered as a full page component, here is the source code for that:
Here I used the
text-blue-500
class, but when going to this page the text doesn't turn blue and there doesn't seem to be any styling associated with that class.
What am I doing wrong? Thank you in advance!
Now I noticed that I don't see in the console that vite is connected, which is strange. Here is my app layout for reference too:
Vite is connected on the panel tho, where my custom components also appear unstyled
Alright, so I've managed to fix this issue on the panel, had to add the component to the sources, but now I'm completely puzzled by why vite isn't connecting to my livewire page (I assume if that's fixed, the styling will work too)Solution
Okay, so I've fixed that too, I'm just leaving the solution here, if you are extending a filament page class and rendering that outside a panel, you have to add the @vite directive to the layout used by the pages (I did this by overwriting the base layout, there might be a better solution)
The better solution is to add this to end of the page:
This way you don't overwrite anything