Install via Composer
composer require spykapps/theme-edinburgh
Ensure your project uses Laravel 12.x and PHP 8.3+.
Publish Assets Run the publisher to copy theme assets (CSS/JS) to your project:
php artisan vendor:publish --tag=edinburgh-theme-assets
This generates a public/vendor/spykapps/theme-edinburgh directory.
Apply the Theme
In your app/Providers/AppServiceProvider.php, add the theme to Filament’s configuration:
use SpykApps\Edinburgh\EdinburghTheme;
public function boot(): void
{
Filament::registerTheme(EdinburghTheme::make());
}
Verify Refresh your Filament admin panel to see the theme applied. Check the dark mode toggle (if enabled) and sidebar gradients.
Modify the theme’s colors or fonts by extending the published assets:
resources/css/filament/edinburgh.css (if published).--edinburgh-gray, --edinburgh-brass) in your project’s CSS:
@import 'vendor/spykapps/theme-edinburgh/css/edinburgh.css';
:root {
--edinburgh-gray: #1a1a2e; /* Darker gray */
}
Extend the Theme Class:
Create a custom theme class extending EdinburghTheme to modify defaults:
namespace App\Filament\Themes;
use SpykApps\Edinburgh\EdinburghTheme;
class CustomEdinburghTheme extends EdinburghTheme
{
public static function make(): static
{
return parent::make()
->colors([
'primary' => '#d4af37', // Custom brass
]);
}
}
Register it in AppServiceProvider:
Filament::registerTheme(CustomEdinburghTheme::make());
Dynamic Theming:
Use Filament’s Theme service to toggle the theme programmatically:
use Filament\Support\Facades\FilamentTheme;
FilamentTheme::enable('edinburgh');
Compile Custom CSS/JS: If you extend the theme, compile your customizations into a single file:
npm run dev # or `npm run build` for production
Link the compiled file in resources/views/layouts/filament-app.blade.php:
@vite(['resources/css/filament/custom-edinburgh.css'])
Lazy-Loading Assets: For large projects, defer non-critical CSS/JS:
<link rel="preload" href="{{ asset('vendor/spykapps/theme-edinburgh/css/edinburgh.css') }}" as="style" onload="this.onload=null;this.rel='stylesheet'">
useDarkMode hook to sync with user settings:
Filament::registerTheme(EdinburghTheme::make()->useDarkMode());
Override dark mode colors in your CSS:
@media (prefers-color-scheme: dark) {
:root {
--edinburgh-gray: #0a0a1a;
--edinburgh-brass: #e6d5b8;
}
}
edinburgh.css:
.filament-sidebar {
background: linear-gradient(to bottom, #1a1a2e, #2d1b69);
}
clip-path to replicate the "ornate details":
.filament-page {
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 calc(100% - 20px), 0 100%);
}
.filament-table) in your CSS:
.filament-table th {
background-color: var(--edinburgh-gray);
border-bottom: 2px solid var(--edinburgh-brass);
}
.filament-forms input {
border: 1px solid var(--edinburgh-brass);
}
Asset Publishing Issues:
php artisan storage:link
public/vendor/spykapps/theme-edinburgh. If not, re-run the publisher.Theme Registration Order:
AppServiceProvider::boot(). Overriding too early may break Filament’s default styles.CSS Specificity Wars:
.filament-page). Override with !important sparingly:
.filament-page .custom-class {
background: red !important; /* Last resort */
}
Dark Mode Inconsistencies:
@media (prefers-color-scheme: dark) {
.filament-modal {
background: #1a1a2e;
}
}
PHP Version Mismatch:
TypedProperty issues).Inspect Element: Use browser dev tools to verify CSS variables are applied:
:root {
--edinburgh-gray: initial; /* Test if variable loads */
}
Disable Cache: Clear Filament’s view cache if styles don’t update:
php artisan filament:cache:clear
Check for Conflicts: Disable other Filament themes/plugins to isolate issues:
// Temporarily remove other themes in AppServiceProvider
Log Theme Events: Add debug logs in your custom theme class:
public static function make(): static
{
\Log::info('Edinburgh theme initialized');
return parent::make();
}
Custom Theme Variables: Extend the theme’s SCSS variables by publishing the source files:
php artisan vendor:publish --tag=edinburgh-theme-scss
Modify _variables.scss in resources/scss/filament/edinburgh.
Plugin-Specific Overrides: Create a Filament plugin to dynamically apply theme tweaks:
namespace App\Filament\Plugins;
use Filament\Plugin;
class EdinburghCustomizer implements Plugin
{
public function getId(): string
{
return 'edinburgh-customizer';
}
public function register(ContainerRegistry $container): void
{
$container->theme(function (Theme $theme) {
$theme->colors(['danger' => '#d4351c']);
});
}
}
Animation Enhancements:
Add subtle animations using Filament’s transition classes:
.filament-sidebar {
transition: background 0.3s ease;
}
Localization: Override text colors for RTL languages:
[dir="rtl"] .filament-text {
color: var(--edinburgh-text-rtl);
}
Critical CSS: Inline critical CSS for the theme in your layout:
<style>
:root { --edinburgh-gray: #1a1a2e; }
.filament-page { background: var(--edinburgh-gray); }
</style>
Purge Unused CSS: Use Laravel Mix/PurgeCSS to remove unused theme classes:
// vite.config.js
export default defineConfig({
css: {
postcss: {
plugins: [require('tailwindcss'), require('autopref
How can I help you explore Laravel packages today?