osamanagi/filament-abyss-theme
Installation
composer require osamanagi/filament-abyss-theme
Add the theme CSS to your vite.config.js:
export default defineConfig({
plugins: [
laravel({
input: [
'resources/js/app.js',
'vendor/osamanagi/filament-abyss-theme/resources/css/theme.css', // Add this line
],
}),
],
});
Run:
npm run build
Register the Plugin
Add the theme to your Filament admin panel provider (e.g., app/Providers/Filament/AdminPanelProvider.php):
public function panel(Panel $panel): Panel
{
return $panel
->id('admin')
->path('admin')
->plugins([
\Osamanagi\FilamentAbyssTheme\FilamentAbyssThemePlugin::make(),
]);
}
First Use Case The theme will automatically apply to your Filament admin panel. No additional configuration is required for basic usage. Refresh your admin panel to see the Abyss theme in action.
Theme Customization Override the default theme colors or styles by publishing the package's assets:
php artisan vendor:publish --provider="Osamanagi\FilamentAbyssTheme\FilamentAbyssThemeServiceProvider" --tag="filament-abyss-theme-config"
Modify the published config/filament-abyss-theme.php to adjust colors, fonts, or other theme properties.
Conditional Theme Application Dynamically enable/disable the theme based on user roles or preferences:
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
auth()->user()->hasRole('designer')
? \Osamanagi\FilamentAbyssTheme\FilamentAbyssThemePlugin::make()
: null,
]);
}
Integration with Filament Widgets
Ensure widgets and custom components align with the theme by using Filament's built-in styling utilities (e.g., filament-typography, filament-colors). Example:
use Filament\Widgets\StatsOverviewWidget;
StatsOverviewWidget::make()
->columns(2)
->styleFn(fn (array $widgets) => 'bg-gray-800 text-white') // Align with Abyss theme
->widgets([
// ...
]);
Dark/Light Mode Toggle
Leverage Filament's built-in dark mode support to toggle between light and dark variants of the Abyss theme. Ensure your theme.css includes both variants or use CSS variables for dynamic switching.
Theme Development Workflow
npm run build
Collaborative Workflow
For teams, document the theme's customizations in a THEME_CUSTOMIZATIONS.md file. Include:
Asset Build Issues
theme.css to vite.config.js or running npm run build after installation.vite.config.js and rebuild assets:
npm run dev // For development
npm run build // For production
Theme Conflicts
.filament-abyss-theme-*) to target overrides.Dark Mode Inconsistencies
useDarkMode() hook or Tailwind's dark mode classes (e.g., dark:bg-gray-800).Plugin Registration Errors
Panel provider and that no syntax errors exist in the provider file.Inspect Theme Classes Use browser dev tools to inspect the rendered HTML and identify missing or overridden classes. Look for:
<body class="filament-abyss-theme ...">
Check CSS Variables
The theme likely uses CSS variables (e.g., --abyss-primary). Override these in your custom CSS if needed:
:root {
--abyss-primary: #your-color;
}
Clear Cache If changes aren’t reflecting, clear Filament's cache:
php artisan filament:cache-reset
Extend the Theme Create a custom theme by copying the package's CSS to your project and modifying it:
cp vendor/osamanagi/filament-abyss-theme/resources/css/theme.css resources/css/custom-theme.css
Update vite.config.js to use your custom file instead.
Performance Optimization
Version Compatibility
composer.json for stability:
"osamanagi/filament-abyss-theme": "^1.0"
Community Contributions
How can I help you explore Laravel packages today?