Xiaohou
Explore posts from serversFilament color is not reactive
Even hard coding to color into action result the same, action will render correct label, the color doesn't change. For example, when
ban
button (red color) is triggered, now it updates and should render unban
button (green color), it does update the text to unban, but color is still red. After a page refresh, it correctlly display the color to green.13 replies
Filament color is not reactive
I have tried toggle, same thing happend. The ban and unban label will update according to user status, and the badge label on table and infolist will update too, but none of the color update unless the page refresh.
13 replies
How to refer to filament semantic color in blade file?
I looked into the filament button blade file, it seems to use CSS variables to display to colors. You can get the variable by color use support method from filament.
it will give you the custom css variables, something like this
--c-50:var(--primary-50);--c-400:var(--primary-400);--c-600:var(--primary-600);
once you have the css variables by color, just apply the variables to html element, then you can use it by refering it as custom
Now if the primary
color changes in filament, it will reflect in our custom component as well. I'm sure if this is the best way to use the color registered by filament, but I hope it can help anyone who has the same problem.8 replies
How to refer to filament semantic color in blade file?
Thanks for helping me out, but I'm not sure if I understand correctly. I'm happy with the current colors, i don't need a custom theme to replace the default ones.
I just need to render elements with the current registered color in filament. For example. i want to make a div with the 'warning' color filament has registered. without having to refer it as tailwind color. So when I change the filament register color from
warning' => Color::Amber
to warning => Color::Orange
, my component color would update alone with filament.8 replies