Change row color in table builder
I am using Laravel Filament v3 in my project, and I am wondering, how could I change the row color for a specific record in a table, in my case, if
payments_left === 0
I would like to change the row color to green (or any other color for example)
I tried this: https://filamentphp.com/docs/3.x/tables/advanced#custom-row-classes
but it doesn't change the row color.
this adds the classes to the html tag, but it doesn't change the color of the row.
11 Replies
you can use tailwind css classes like bg-green-500
make sure to compile your css
I used tailwind classes, and the code I posted is mine, I just want to know what am I doing wrong, or is there any other way to achieve this?
from the docs
"These classes are not automatically compiled by Tailwind CSS. If you want to apply Tailwind CSS classes that are not already used in Blade files, you should update your content configuration in tailwind.config.js to also scan for classes inside your directory: './app/Filament/*/.php'"
I have it set like this:
looks good
maybe !bg-green-100
Have you set up a custom theme?
no, I haven't, still using the default theme
There is your problem
I create my theme like it write here https://filamentphp.com/docs/3.x/panels/themes
but in my code :
only
bg-green-100 dark:bg-green-800
works, the problem is bg-red-100 dark:bg-red-800
but I don't understand why because even bg-yellow-100 dark:bg-yellow-800
doesn't worksI guess "you should update your content configuration in tailwind.config.js to also scan for classes inside your directory: './app/Filament/*/.php'"
Solution
Thanks yes it was just "npm run build"