how to use Filament `primary`, `success` color
Hi, I want to use some color of Filament in custom form field to consistency look and field, but I don't know how to make it, because user can change the color in the PanelServiceProvider. Anyone has a good approach for this situation, thank you
9 Replies
you mean you want to let your users chose the color?
maybe this can help
https://filamentphp.com/community/mohamedsabil83-easy-way-to-benefit-from-the-new-color-mechanism-in-frontend
Filament
Customizing colors per-user outside of a panel by Mohamed Sabil - F...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
nope, I mean in my plugin custom field, I do has a class like
peer-checked:ring-primary-900
, but it's doesn't work in Filament because the color is not the same in the user config (in the PanelProvider) vs in my tailwind.config.js file of my pluginas you can see, the border of name input is configured by the user
the provider checkbox is a custom form field, and the border not the same
I though it should be something in css variable tho, but I don't know how
Solution
Solved using this one, but it seem terrible
Since you’re users are setting their own color and tailwind compiles against the code base you will have to use the css property approach in this specific use case.
thanks, btw it feel little pain when write css like that 🥹 , luckily I only have to write it once
yea, just the nature of tailwind and how it works. It's just not meant to be modular like that. 🙂