Loheide-eu-mitarbeiterplatt.../app/Support/Theme/Fonts.php
Friederich Loheide 82bbeef31b
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m7s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m11s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m16s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m18s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 2m49s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 2m46s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 2m41s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 2m33s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m0s
Phase 5: Erscheinungsbild mit Entwurf, Vorschau und Veröffentlichen
- Theme in den Einstellungen (Entwurf/veröffentlicht), Übernahme der
  Einstellungen aus Phase 0; statische CSS-Datei mit Hash beim Veröffentlichen
- Logos hell/dunkel, Signet, App-Symbol → Favicon, Homescreen-Symbole,
  Web-App-Manifest; SVG-Bereinigung
- Markenfarbe exakt, zweite Akzentfarbe, Kopfleiste hell/Marke/dunkel,
  Kontrastprüfung (WCAG AA) mit automatisch lesbarer Linkfarbe
- Lokale Schriften (Latein), Überschriften-Schrift, eigene WOFF2-Schrift,
  Ecken, Dichte, Dunkelmodus-Regel
- Anmeldeseite (geteilt/zentriert, Bild, Texte), Fußzeile, E-Mails im Design
- Admin: Live-Vorschau (Startseite, Anmeldung, Beispielseite; hell/dunkel),
  Veröffentlichen, Verwerfen, Export/Import, Zurücksetzen, eigenes CSS
- Admin-Bereich übernimmt Logo, Farbe und Favicon; Whitelabel

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 10:46:05 +00:00

55 lines
2.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
namespace App\Support\Theme;
/**
* Mitgelieferte Schriften – lokal ausgeliefert (resources/css/fonts.css,
* erzeugt von scripts/generate-fonts-css.py), nie von Google Fonts.
*/
final class Fonts
{
public const FALLBACK_SANS = 'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';
public const FALLBACK_SERIF = 'ui-serif, Georgia, Cambria, "Times New Roman", serif';
/** Schlüssel => [Bezeichnung, CSS-Familie, serif?] */
public const FONTS = [
'inter' => ['Inter', 'Inter Variable', false],
'source-sans-3' => ['Source Sans 3', 'Source Sans 3 Variable', false],
'open-sans' => ['Open Sans', 'Open Sans Variable', false],
'nunito-sans' => ['Nunito Sans', 'Nunito Sans Variable', false],
'roboto' => ['Roboto', 'Roboto Variable', false],
'ibm-plex-sans' => ['IBM Plex Sans', 'IBM Plex Sans Variable', false],
'figtree' => ['Figtree', 'Figtree Variable', false],
'atkinson' => ['Atkinson Hyperlegible (besonders gut lesbar)', 'Atkinson Hyperlegible', false],
'source-serif-4' => ['Source Serif 4 (Serifen)', 'Source Serif 4 Variable', true],
'merriweather' => ['Merriweather (Serifen)', 'Merriweather Variable', true],
'lora' => ['Lora (Serifen)', 'Lora Variable', true],
'system' => ['Systemschrift des Geräts', null, false],
];
/** Familienname einer hochgeladenen Schrift. */
public const CUSTOM_FAMILY = 'Portal Eigene Schrift';
/**
* @return array<string, string>
*/
public static function options(bool $withCustom = false): array
{
$options = array_map(fn (array $font) => $font[0], self::FONTS);
return $withCustom ? $options + ['custom' => 'Eigene Schrift (hochgeladen)'] : $options;
}
public static function stack(string $key): string
{
if ($key === 'custom') {
return '"'.self::CUSTOM_FAMILY.'", '.self::FALLBACK_SANS;
}
[, $family, $serif] = self::FONTS[$key] ?? self::FONTS['inter'];
$fallback = $serif ? self::FALLBACK_SERIF : self::FALLBACK_SANS;
return $family ? '"'.$family.'", '.$fallback : $fallback;
}
}