F
Filamentβ€’13mo ago
Kiran Timsina

Can't get the colors to work

I am trying to follow the statsoverview docs and create some cards like this: Card::make( 'Idle Bakers', "$idleBakers" )->color($idleBakers > 0 ? 'warning' : 'success'), Card::make( 'Unprocessed Orders', "$unprocessedOrders" )->color(($idleBakers && $unprocessedOrders) ? 'danger' : (($unprocessedOrders && !$idleBakers) ? 'warning' : 'success')), Card::make( 'Ready Orders', "$readyOrders" ), Card::make( 'Idle Riders', "$idleRiders" )->color(($readyOrders && $idleRiders) ? 'danger' : (($readyOrders && !$idleRiders) ? 'warning' : 'success')), My tailwind.config.js, vite.config.js and postcss.config.js are as per this doc: https://filamentphp.com/docs/2.x/admin/appearance#building-themes Here is my AppServiceProvider public function boot(): void { // Filament::serving(function () { // // Using Vite // Filament::registerViteTheme('resources/css/filament.css'); // }); } I have commented the code becuase it makes the whole ui break as filament.css is not present
Filament
Appearance - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
7 Replies
Vp
Vpβ€’13mo ago
You forgot this section "In /resources/css/filament.css, import Filament's vendor CSS:" you need to create filament.css inside resources/css and inside filament.css file @import '../../vendor/filament/filament/resources/css/app.css';
Andrew Wallo
Andrew Walloβ€’13mo ago
If you are talking about the color on the bottom of the card, you have to use the ->chart([]) option as well I think.
Kiran Timsina
Kiran Timsinaβ€’13mo ago
I'm only trying to use colors which is not working throughout the project due to some misconfiguration I did.
Andrew Wallo
Andrew Walloβ€’13mo ago
So did you do what the guy above mentioned about?
Kiran Timsina
Kiran Timsinaβ€’13mo ago
It solved the missing filament.css file issue. But it's not compiling now. [vite:css] [postcss] /Users/kiran/ug/backend/vendor/filament/forms/dist/module.esm.css:1618:3: The bg-primary-600 class does not exist. If bg-primary-600 is a custom class, make sure it is defined within a @layer directive. file: /Users/kiran/ug/backend/resources/css/filament.css:1618:3 I recopied the vite.config.js and rebuilt. it built fine now. Thank you so much @.valpuia After several weeks, my dashboard has some colors! πŸ˜„
Vp
Vpβ€’13mo ago
Glad it helps..
Kiran Timsina
Kiran Timsinaβ€’13mo ago
Filament
Installation - Notifications - Filament
Elegant TALL stack notifications for Laravel artisans.
Filament
Appearance - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.