Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 7m50s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 7m34s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m45s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 5m30s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m7s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m9s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 6m8s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m5s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 48s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m5s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
43 lines
2.2 KiB
PHP
43 lines
2.2 KiB
PHP
<?php
|
||
|
||
namespace App\Filament\Pages\Appearance;
|
||
|
||
use App\Filament\Components\SafeUpload;
|
||
use App\Support\Theme\Fonts;
|
||
use App\Support\Theme\Theme;
|
||
use BackedEnum;
|
||
use Filament\Forms\Components\FileUpload;
|
||
use Filament\Forms\Components\Radio;
|
||
use Filament\Forms\Components\Select;
|
||
use Filament\Schemas\Components\Utilities\Get;
|
||
use Filament\Support\Icons\Heroicon;
|
||
|
||
class AppearanceTypography extends AppearancePage
|
||
{
|
||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedLanguage;
|
||
|
||
protected static ?int $navigationSort = 3;
|
||
|
||
protected static ?string $navigationLabel = 'Schrift & Form';
|
||
|
||
protected static ?string $title = 'Schrift & Form';
|
||
|
||
protected static ?string $slug = 'schrift';
|
||
|
||
protected function fields(): array
|
||
{
|
||
return [
|
||
Select::make('font_body')->label('Schrift')->options(fn (Get $get) => Fonts::options((bool) $get('custom_font')))->required()->native(false),
|
||
Select::make('font_heading')->label('Schrift für Überschriften')->options(fn (Get $get) => ['same' => 'Wie die Schrift'] + Fonts::options((bool) $get('custom_font')))->required()->native(false),
|
||
FileUpload::make('custom_font')->label('Eigene Schrift (WOFF2)')
|
||
->helperText('Z. B. die Hausschrift aus dem Corporate Design. Wird lokal ausgeliefert – keine Verbindung zu Google oder anderen Diensten. Bitte die Lizenz für die Nutzung im Web beachten.')
|
||
->disk('uploads')->directory('theme/fonts')->visibility('public')->maxSize(2048)
|
||
->acceptedFileTypes(['font/woff2', 'application/font-woff2', 'application/octet-stream'])
|
||
->getUploadedFileNameForStorageUsing(fn ($file) => SafeUpload::name($file, 'woff2'))
|
||
->rule('extensions:woff2')->live()->columnSpanFull(),
|
||
Radio::make('radius')->label('Ecken')->options(collect(Theme::RADII)->map(fn ($r) => $r[0])->all())->inline()->required(),
|
||
Radio::make('density')->label('Abstände')->options(collect(Theme::DENSITIES)->map(fn ($d) => $d[0])->all())->inline()->required(),
|
||
Radio::make('dark_mode')->label('Dunkelmodus')->options(Theme::DARK_MODES)->required()->columnSpanFull(),
|
||
];
|
||
}
|
||
}
|