recordClasses() is only correctly applied to the first entry of a Table

https://filamentphp.com/docs/3.x/tables/advanced#custom-row-classes Calling this fn in the table view leads to only style the first row correctly - every other row falls back to default even the returns are true
->recordClasses(fn (Booking $record) => match ($record->state) {
State::InApproval => 'border-l-4 border-red-600',
State::Approved => 'border-l-4 border-blue-600',
State::Invoiced => 'border-l-4 border-blue-600',
State::Paid => 'border-l-4 border-green-600',
default => null,
})
->recordClasses(fn (Booking $record) => match ($record->state) {
State::InApproval => 'border-l-4 border-red-600',
State::Approved => 'border-l-4 border-blue-600',
State::Invoiced => 'border-l-4 border-blue-600',
State::Paid => 'border-l-4 border-green-600',
default => null,
})
3 Replies
max_dev
max_dev7mo ago
No description
max_dev
max_dev7mo ago
Solution: The CSS is overwritten by filament css. Therefore it needs to be important. !border-l-4 !border-red-600
nathan
nathan7d ago
This was a huge help!! Thank you!