CSS not being applied to my tables
So I am completely new to filament, I just installed filament into my app. I followed the steps provided by the documentation. I am working on laravel.
Basically my steps were:
- Installed filaments/table only
- then installed filaments
(tailwind i already had installed before, so i skipped all the tailwind installation steps)
- added @FilamentStyles and @FilamentScripts as stated to my main layout
- added (@import '../../vendor/filament/tables/resources/css/index.css';) to my app.css
- in my already existing livewire component, i added hasaction, hastable and hasschema and their use tags
- i added a table function that loads my table
it loads but i dont see any css applied to it, am i missing something?
38 Replies

You did run
php artisan filament:install
?
Did you recompile your Tailwind file?
Can you check DevTools:
a) Whether your CSS is loaded
b) What content is loaded.yea i ran that and css is loaded cause everything in the css works
but now i get the issue of /vendor/filament/support/resources/css/components/badge.css:45:9: The
bg-color-50
class does not exist. If bg-color-50
is a custom class, make sure it is defined within a @layer
directive.V4?
yea tailwind v4.1.+
please can you help me, been trying for 12 hours trying to fix these issues, i even reinstalled every single dependendy, wireui, tailwind, filament and i end up there
im using these steps here

and end up with the same error of bg-color-50
i even tried adding a bg-color-50 to see if it lets me pass, but it said again ring-50
You need to add all css required by tables
okay thanks, but now i get to an issue that says use strict?
/node_modules/tailwindcss/lib/index.js:1:1: Unknown word "use strict"

fyi
this is the app.css
Remove base, components, utilities
did so but it is still there
removed
still the same strict message
my code now

what about
vite.config.js
?Solution
Do you still have a
postcss.config.js
? If yes: Remove itYea I fixed it by removing postcss and using vite
But doing that made all my components use the primary and secondary color that filament provides
Im trying to change the colors but I can’t seem to find customization in the documentation @Dennis Koch @LeandroFerreira
I'm kinda having the same problem. I have a custom page within filament which needs some custom styling with tailwind. I followed the steps in the documentation, but now none of the styles are applied.
1. In the
AdminPanelProvider
, I added ->viteTheme('resources/css/filament/admin/theme.css')
2. I ran php artisan make:filament-theme
3. In the theme file, I added the contents as above:
4. In vite.config.js, I added resources/css/filament/admin/theme.css
to the input array
5. I ran npm run build
It looks like it's totally overriding the filament theme and not applying the styles from the 'normal' theme. How can I extend the theme instead of overriding it?You do not need to add the CSS code to the theme. It should work already.
Same question for you: Do you still have a
postcss.config.js
?Ok, but as soon as I add the viteTheme to my panel, the styling breaks. Without it, the css file is not included.
No, no postcss, this is a clean laravel 12 / filament 4 install
Check the DevTool: Is the
theme.css
included? What's the content of it?When I add the viteTheme, it is included, but css/filament/filament/app.css is not anymore. In compiled the theme.css only the fonts are included
It’s it possible to make the colors defined in tailwind.config override the filament default colors, like primary and secondary
When I add the viteTheme, it is included, but css/filament/filament/app.css is not anymoreThat's expected.
In compiled the theme.css only the fonts are includedNo styles at all? Can you show a screenshot of that file?
Applied some formatting, but it contains the Inter font

That's all the content?
yep
Can you share your uncompiled theme.css?
🤷♂️
you stated earlier that it was not needed to include the other files
No. It's not needed to overwrite the created
theme.css
file. You still need to keep the lines that were added when you created it
Remove it, and run php artisan make:filament-theme
again.
Keep that content.Ok, the generated theme now contains more css, but still all the styling is broking
in the generated css, I see:
That media query doesn't look right to me
You recompiled it?
yeah
my source theme file now contains:
To be sure, this vite.config is correct?
Not sure whether that's inlcuded in
laravel()
but the Tailwind plugin is missing: https://tailwindcss.com/docs/installation/using-viteInstalling with Vite - Installation
Integrate Tailwind CSS with frameworks like Laravel, SvelteKit, React Router, and SolidJS.
It should look like this:
Thanks! That did it
It’s this possible