some Tailwind classes not working

I have Filament v3, with Tailwind v3.4 A lot of the tailwind classes work, but some just don't, and sometimes they do in some areas, some seem to be missing what I am trying to do right now is
<div class="grid grid-cols-2 gap-4" > ....
<div class="grid grid-cols-2 gap-4" > ....
The gap is applied, so is the grid, but grid-cols-2 just never works. same with margins m-5 m-6 m-7 All filament pages seem to be styled, nothing off, but I didn't apply any extra styles there What I am trying to style is a LiveWire component that sits in a csutom filament page I have followed and installed everything following the theme install docs: https://filamentphp.com/docs/3.x/panels/themes#creating-a-custom-theme I rebuilt using npm run dev and npm run build my tailwind config:
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
I noticed that, under public, there is several css generated The app and Theme has the grid-cols-2 but I also notices that they arent imported when I check the page code in browser? I did find that the page references a theme css file, but the content and path are not the one in the public folder I'm stumped
No description
No description
Solution:
views are in: resources/view/livewire/... Tailwind config was: ```js content: [...
Jump to solution
24 Replies
bakriawad
bakriawadOP11mo ago
the theme being referenced
No description
awcodes
awcodes11mo ago
You missed a step. Probably forgot to add the theme to ->viteTheme() in your panel provider. And / or didn’t add it to you Vite config. The instructions for that are on the doc you linked and mentioned in the terminal after running filament:theme.
bakriawad
bakriawadOP11mo ago
it is present there
No description
No description
bakriawad
bakriawadOP11mo ago
I redid the setup just incase I messed up, still nothing
awcodes
awcodes11mo ago
This is not the right url. That url is the raw file. Not the built asset.
bakriawad
bakriawadOP11mo ago
No description
awcodes
awcodes11mo ago
You did run npm run build right.
bakriawad
bakriawadOP11mo ago
No description
bakriawad
bakriawadOP11mo ago
yup
bakriawad
bakriawadOP11mo ago
Vite running as well
No description
awcodes
awcodes11mo ago
Are you seeing any console errors in the browser?
bakriawad
bakriawadOP11mo ago
nope all clear, no file download failures either
awcodes
awcodes11mo ago
Could be a mismatch on your app_url too.
bakriawad
bakriawadOP11mo ago
It seems it is loading the theme css
No description
bakriawad
bakriawadOP11mo ago
but as :md
bakriawad
bakriawadOP11mo ago
and 32xl ??
No description
awcodes
awcodes11mo ago
Not sure. Sorry, something isn’t setup right.
bakriawad
bakriawadOP11mo ago
but this seems to not work You can see in the styles, searching for grid does not show the styling for grid-cols-2
No description
No description
bakriawad
bakriawadOP11mo ago
I can see that, but I really can't tell what it can actually be. margins seem to not work either
awcodes
awcodes11mo ago
My guess is it’s loading the wrong theme file. Where is the view file located that you are using those classes in? And what is in the content key of resources/css/filament/admin/tailwind.config.js
bakriawad
bakriawadOP11mo ago
ah. figured.
Solution
bakriawad
bakriawad11mo ago
views are in: resources/view/livewire/... Tailwind config was:
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
I added
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./resources/views/livewire/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
content: [
'./app/Filament/**/*.php',
'./resources/views/filament/**/*.blade.php',
'./resources/views/livewire/**/*.blade.php',
'./vendor/filament/**/*.blade.php',
],
` Seems to work now. I am bout to jump off a bridge now
awcodes
awcodes11mo ago
Happens to a lot of people. Don’t worry about it.
bakriawad
bakriawadOP11mo ago
Thanks a lot!
Want results from more Discord servers?
Add your server