F
Filamentβ€’4mo ago
taz

FIlament Blade components outside filament. Change default primary color

I am using some filament blade components outside Filament, in a classical blade template.
<x-filament::button
icon="heroicon-s-paper-airplane"
icon-position="after"
color="primary"
>
Start Free Trial
</x-filament::button>
<x-filament::button
icon="heroicon-s-paper-airplane"
icon-position="after"
color="primary"
>
Start Free Trial
</x-filament::button>
So in my app layout blade file I added Filament styles:
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'myapp') }}</title>
<link rel="icon" href="favicon.ico" />
@vite(['resources/css/app.css', 'resources/js/app.js'])
@filamentStyles
</head>
<body {{ $attributes->merge(['class' => 'bg-noir-900']) }}>
{{ $slot }}
@stack('scripts')
</body>
</html>
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'myapp') }}</title>
<link rel="icon" href="favicon.ico" />
@vite(['resources/css/app.css', 'resources/js/app.js'])
@filamentStyles
</head>
<body {{ $attributes->merge(['class' => 'bg-noir-900']) }}>
{{ $slot }}
@stack('scripts')
</body>
</html>
Everything works fine but how to change the primary color. I want to change the default yellow color for the components when setting 'primary' on the components color attribute. Thanks you. Filament is awesome by the way !
6 Replies
Umar Farooq
Umar Farooqβ€’4mo ago
inside the service provider you can change the color
->colors([
'primary' => Color::Amber,
])
->colors([
'primary' => Color::Amber,
])
Oxygarum
Oxygarumβ€’4mo ago
I have the same question. In a blade component outside Filament the primary default color is not recognized. It is always going back to the standard yellow πŸ™‚
Oxygarum
Oxygarumβ€’4mo ago
Now I did, thanks a lot πŸ˜„ Works!
taz
tazβ€’3mo ago
Solved my problem. Thanks you @Leandro Ferreira
Want results from more Discord servers?
Add your server