Remove/customize default button classes

Hey everyone! I've got a requirement to make the buttons look more like the corporate design of the client which looks quite different than the buttons currently look in filament. Is there a way to have existing classes for the button component (specified in the $buttonClasses variable inside of vendor/filament/support/resources/views/components/button/index.blade.php) removed? I'd need to have them customized as there are a few classes that I can't remove as the extraAttributes() method only adds/merges classes but doesn't remove them. Thank you very much!
2 Replies
Patrick Boivin
Patrick Boivin14mo ago
I think I would go with custom CSS instead of overriding some of the internal button view. If you have a custom theme setup, you can easily use @apply to target all buttons via .fi-btn.
tom hatzer
tom hatzerOP14mo ago
Thanks @Patrick Boivin , that's what I'm doing right now but the problem is resetting all the current/existing classes doesn't work at all times. CSS rules like all: revert/unset/initial cause some strange behaviours if you combine them with your new styling in the same class definition.
Want results from more Discord servers?
Add your server