PHP code example of elemind / press-filament-theme

1. Go to this page and download the library: Download elemind/press-filament-theme library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elemind / press-filament-theme example snippets


use Elemind\PressFilamentTheme\PressFilamentTheme;
use Elemind\PressFilamentTheme\Enums\PressVariant;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(
            PressFilamentTheme::make()->variant(PressVariant::Telex)
        );
}

PressFilamentTheme::make()->broadsheet();
PressFilamentTheme::make()->telex();
PressFilamentTheme::make()->gutter();
PressFilamentTheme::make()->vellum();

PressFilamentTheme::make()->telex()->rail(false); // keep Filament's sidebar

use Filament\Enums\ThemeMode;

->defaultThemeMode(ThemeMode::Dark)

->font('Instrument Sans', url: asset('css/fonts/instrument-sans.css'))

PressFilamentTheme::make()->telex()->applyTheme(false); // never set the packaged theme

PressFilamentTheme::make()->broadsheet()->runtimeSwitch();

PressFilamentTheme::make()->runtimeSwitch([PressVariant::Telex, PressVariant::Gutter]);

PressFilamentTheme::make()
    ->runtimeSwitch()
    ->variantResolver(fn () => auth()->user()?->press_variant)
    ->variantPersister(fn (PressVariant $variant) => auth()->user()->update([
        'press_variant' => $variant->value,
    ]));

PressFilamentTheme::make()->runtimeSwitch()->switcherUi(false);   // not in the user menu

PressFilamentTheme::variantAction()                              // put it where you like
bash
php artisan filament:assets
bash
php artisan vendor:publish --tag="press-filament-theme-css"