You've already forked Atomcms-edit
Apply theme navbar colors to Filament admin panel topbar and user menu
This commit is contained in:
@@ -16,6 +16,7 @@ use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
|||||||
use Filament\Panel;
|
use Filament\Panel;
|
||||||
use Filament\PanelProvider;
|
use Filament\PanelProvider;
|
||||||
use Filament\Support\Colors\Color;
|
use Filament\Support\Colors\Color;
|
||||||
|
use Filament\View\PanelsRenderHook;
|
||||||
use Filament\Widgets\AccountWidget;
|
use Filament\Widgets\AccountWidget;
|
||||||
use Filament\Widgets\FilamentInfoWidget;
|
use Filament\Widgets\FilamentInfoWidget;
|
||||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||||
@@ -67,6 +68,37 @@ class AdminFilamentPanelProvider extends PanelProvider
|
|||||||
->authMiddleware([
|
->authMiddleware([
|
||||||
Authenticate::class,
|
Authenticate::class,
|
||||||
])
|
])
|
||||||
->plugins([]);
|
->plugins([])
|
||||||
|
->renderHook(PanelsRenderHook::STYLES_AFTER, function (): string {
|
||||||
|
$navbarBg = setting('color_navbar', '#2d2d44');
|
||||||
|
$navbarText = setting('color_navbar_text', '#ffffff');
|
||||||
|
|
||||||
|
return <<<HTML
|
||||||
|
<style>
|
||||||
|
.fi-topbar {
|
||||||
|
background-color: {$navbarBg} !important;
|
||||||
|
}
|
||||||
|
.fi-topbar-item-label,
|
||||||
|
.fi-sidebar-item-label,
|
||||||
|
.fi-sidebar-group-label,
|
||||||
|
.fi-sidebar-database-notifications-btn-label,
|
||||||
|
.fi-user-menu-trigger-text {
|
||||||
|
color: {$navbarText} !important;
|
||||||
|
}
|
||||||
|
.fi-topbar-item-btn:hover,
|
||||||
|
.fi-sidebar-item-btn:hover {
|
||||||
|
background-color: {$navbarBg} !important;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn {
|
||||||
|
background-color: {$navbarBg} !important;
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label {
|
||||||
|
color: {$navbarText} !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
HTML;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user