F
Filament2w ago
🤠

Filament 4 Style Issues on Livewire Components

I'm having trouble creating a Livewire component that uses Filament forms in Filament 4. The styles just don't show up. I have already imported the styles in the page css: @import '../../vendor/filament/support/resources/css/index.css'; @import '../../vendor/filament/forms/resources/css/index.css'; @import '../../vendor/filament/schemas/resources/css/index.css'; @import 'tailwindcss'; @source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/.blade.php'; @source '../../storage/framework/views/.php'; @source '..//.blade.php'; @source '..//.js'; and I used @FilamentStyles and @FilamentScripts, and still, nothing.
Solution:
I ended up deleting everything and recreating it following the steps you all provided, and it seems to be working now
Jump to solution
11 Replies
toeknee
toeknee2w ago
Did you run npm build? are you sure the scripts are added to the html? If you put <!-- Filament --> before the call for the styles/scripts do you see it in the browser console?
🤠
🤠OP2w ago
Yes, I did
No description
No description
No description
Dennis Koch
Dennis Koch2w ago
Can you check the dev tools whether the CSS files are requested? Also check the actual content of them.
🤠
🤠OP2w ago
I will check
awcodes
awcodes2w ago
You need to @source the filament views too.
Dennis Koch
Dennis Koch2w ago
Shouldn't that be done in Filaments CSS files?
awcodes
awcodes2w ago
if you look at the css files, it is not. I also believe the sources have to be in the main file that tailwind is using as it's 'config'. https://github.com/filamentphp/filament/blob/4.x/packages/forms/resources/css/index.css
GitHub
filament/packages/forms/resources/css/index.css at 4.x · filamentp...
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire - filamentphp/filament
Dennis Koch
Dennis Koch2w ago
Wait, we don't need @sources anymore, as we don't use TW classes directly. So that shouldn't be an issue.
awcodes
awcodes2w ago
you're right. ignore me. lol
Solution
🤠
🤠2w ago
I ended up deleting everything and recreating it following the steps you all provided, and it seems to be working now
🤠
🤠OP2w ago
The problem was in my vite Well, thanks for the help, and sorry for the inconvenience

Did you find this page helpful?