Table recordClasses dark mode
Hello,
This piece of code works fine in default mode, but in dark no change (text-color, bg) !
->recordClasses(fn (Model $record) => match ($record->status) {
QuotationStatusEnum::DRAFT => '!opacity-30',
QuotationStatusEnum::CONFIRMED => '!border-l-4 !border-l-green-600 bg-green-50 dark:text-gray-900 dark:bg-green-30',
QuotationStatusEnum::CANCELLED => '!border-l-4 !border-orange-600 bg-orange-50 dark:text-gray-900 dark:border-orange-300',
default => null,
})
Solution:Jump to solution
try this
```css
.table-row-green {
@apply border-l-4 bg-success-50 !border-l-success-600 dark:bg-success-300;
}...
22 Replies
Are those classes encluded in the stylesheet?
Where to check and how to add them ?
Coz it works fine in default mode
bg-green-30 ?
Yes you're right, bg-green-50 works, but Text-green-900 doesnt' work
or any text color
add a new class in the record classes, like
custom-color
then, you can use in your theme.css
because the table cell uses fi-ta-text-item-label
class to apply the text colorThanks @Leandro Ferreira
Please where to put that css class ?
did you create a custom theme?
Yes
this creates a .css file
β Next, register the theme in the admin panel provider using
->viteTheme('resources/css/filament/admin/theme.css')
My theme.css contains :
@import "../../../../vendor/filament/filament/resources/css/theme.css";
@import "../../../../node_modules/cropperjs/dist/cropper.css";
@import "../../../../vendor/awcodes/filament-curator/resources/css/plugin.css";
@import "../../../../vendor/awcodes/filament-tiptap-editor/resources/css/plugin.css";
@config './tailwind.config.js';
Should I put it here ?
yep
Didn't work :/
did you run npm run dev or build?
yes every time
Just to confirm, I can use any tailwind css color right ?
yes
it should work
Im taking care of my daughter and I'll return in few minutes π
Hhh it's okey, thanks π
Solution
try this
Yay ! it works !! thank you so much π π
Hi @Leandro Ferreira
I have a small issue please π
How can I change row hover text color on dark mode ? usign the previous css code π
I tried this :
.table-row-confirmed {
@apply border-l-4 !border-l-success-600 bg-green-50 dark:hover:text-white;
}
.table-row-confirmed .fi-ta-text-item-label {
@apply text-gray-950 dark:text-gray-900 dark:hover:text-white;
}
some class with
:hover
I guess
Inspect the element and check where is hover
I think it says fi-ta-row
Sorry I'm not expert in css :/
and I want to set the whole row text color to white for example