northwestern-sysdev/northwestern-filament-theme
Installation:
composer require northwestern-sysdev/northwestern-filament-theme
Ensure your project meets the requirements: PHP 8.3+, Laravel 12/13, and Filament 4/5.
Register the Plugin:
Add the theme to your PanelProvider (e.g., app/Providers/Filament/AdminPanelProvider.php):
use Northwestern\FilamentTheme\NorthwesternTheme;
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
NorthwesternTheme::make(),
// Other plugins...
]);
}
First Use Case: Refresh your Filament admin panel. The theme will automatically apply Northwestern’s branding (colors, typography, and UI elements) without additional configuration.
Theme Integration:
Customization Points:
app/Providers/AppServiceProvider.php:
NorthwesternTheme::configure(fn (NorthwesternTheme $theme) => $theme
->colors(['primary' => '#123456']) // Customize palette
->fonts(['body' => 'Inter']) // Override typography
);
modify method to target specific UI elements:
NorthwesternTheme::make()->modify(function (NorthwesternTheme $theme) {
$theme->modifyCard(function (Card $component) {
$component->classes(['bg-nu-blue-50']);
});
});
Dark Mode Support:
NorthwesternTheme::make()->darkMode(true);
Asset Publishing:
php artisan vendor:publish --tag=northwestern-filament-theme-assets
Localization:
NorthwesternTheme::make()->translations([
'nu' => [
'labels' => [
'dashboard' => 'NU Dashboard',
],
],
]);
Plugin Registration Order:
NorthwesternTheme before other plugins that might override styles (e.g., Filament\Plugins\Settings). Test your panel after adding the theme to catch conflicts early.Caching Issues:
php artisan filament:cache-reset
Filament 5.x Migration:
Card → filament-card) may differ. Refer to the changelog for breaking changes.Asset Paths:
/vendor/northwestern-sysdev/...). Use the package’s helper methods:
NorthwesternTheme::asset('images/logo.svg');
nu-{color}-{shade}) are applied. Missing classes often indicate registration or caching issues.config/filament.php to log plugin initialization:
'debug' => env('FILAMENT_DEBUG', false),
Custom Components:
php artisan vendor:publish --tag=northwestern-filament-theme-views
resources/views/vendor/northwestern-filament-theme/components/card.blade.php.Dynamic Theming:
Livewire hooks to dynamically switch themes (e.g., based on user role):
use Northwestern\FilamentTheme\NorthwesternTheme;
NorthwesternTheme::make()->hook('theme.switch', function () {
// Logic to toggle theme (e.g., via API)
});
Testing:
Performance:
Fallbacks:
NorthwesternTheme::make()->fallbacks([
'colors' => ['primary' => '#000000'], // Fallback if NU palette fails to load
]);
```markdown
---
**Note**: For advanced use cases (e.g., multi-tenancy with dynamic branding), consider forking the package or extending it via a custom plugin that wraps `NorthwesternTheme`.
How can I help you explore Laravel packages today?