Extracts the system-font list already used by RichTextEditor for mail
templates into a shared hifi-src/src/utils/fontOptions.js (frontend) and
App\Support\Fonts (backend), so it can drive two new pickers with a
consistent set of options.
Global: a new app_settings.site_font setting, exposed as an admin dropdown
in WebsiteSettings.jsx. tailwind.config.js now defines font-sans as
var(--site-font, ui-sans-serif, system-ui, sans-serif); Tailwind's
preflight already applies font-sans globally to <html>, so this alone
makes the chosen font cascade to virtually every text on the public site
without touching individual components. PublicLayout.jsx sets the CSS
variable from the fetched site settings.
Per-section override: a new home_sections.font_family column, editable
per homepage section in HomeSections.jsx ("Standard" = inherit the global
font). Home.jsx applies it as an inline style on each section's wrapper,
which naturally wins over the CSS-variable-driven global default when
set. Reveal.jsx gained an optional style prop (merged into its own
transform/opacity style) so the four flowing-text sections, which use it
directly as their wrapper, can receive the override too.
Verified locally: migration adds both columns without touching existing
rows, and both settings round-trip correctly through the database.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
13 lines
910 B
JavaScript
13 lines
910 B
JavaScript
// Bewusst klassische, auf jedem Geraet vorinstallierte Schriftarten statt eigens gehosteter
|
|
// Web-Fonts: fuer E-Mail-Vorlagen laden Mail-Clients @font-face-Schriften oft gar nicht und
|
|
// fallen dann unvorhersehbar zurueck; fuer die Website selbst spart es zusaetzliche
|
|
// Ladevorgaenge. Von RichTextEditor (Mail-Vorlagen/Rechtstexte) und den Schriftart-Auswahlen
|
|
// fuer die Website (global + pro Startseiten-Sektion) gemeinsam genutzt.
|
|
export const FONT_OPTIONS = [
|
|
{ label: 'Systemschrift', value: '' },
|
|
{ label: 'Serifenlos (Arial)', value: 'Arial, Helvetica, sans-serif' },
|
|
{ label: 'Serif (Georgia)', value: 'Georgia, "Times New Roman", serif' },
|
|
{ label: 'Klassisch (Times New Roman)', value: '"Times New Roman", Times, serif' },
|
|
{ label: 'Modern (Verdana)', value: 'Verdana, Geneva, sans-serif' },
|
|
{ label: 'Schreibmaschine (Courier New)', value: '"Courier New", Courier, monospace' },
|
|
];
|