Issue with button color theming on front-end (forms, etc)
Hi all — I'm very likely being daft here but I'm having an issue with buttons showing up without colours on the front end. Text etc fields seem to work ok. I've followed the guide here for getting forms on the front end: https://filamentphp.com/docs/3.x/forms/installation and looked all over the "Colors" section in core concepts (https://filamentphp.com/docs/3.x/support/colors) but am at a loss as to what might be going on. I've attached an example of how it looks. Almost certain to be missing some crucial step here or not understanding some high level concept but if anyone has any advice on this I'd really appreciate it. Scratching my head here!
6 Replies
You should just be able to use your defined tailwind colors for frontend work - thats what we do
We define a set of brand colors inside tailwind.config.js - its separate to our backend which is built with filament-panels
Sort of half fixed this by doing the following in tailwind config:
(Specifically the colors bit)
Looks like this now
But doesn't feel like I've gone down the right path at all, and weirdly "Cancel" still looks wrong
Oh, I can account for cancel actually, I had some custom classes in the button component
Submit is super basic though:
It sounds like you’re missing the filament preset in your tailwind.config.js.
Or you’re missing the necessary content routes.
Happy to post the full config here —
Weirdly though there is no difference on the front end when I comment/uncomment that preset definition 🤨
Ohhh myyyy..... I see what's wrong, I called it "preset" not "presets" 🤦♂️
Jeezo, that was it! I've removed that colors nonsense and made the include consistent with the others (just slapped it straight into the
preset
array and it's all working now, it uses the colours I've defined in AppServiceProvider
with FilamentColor::register
I can go from here, thanks for the rubber-ducking and help folks!