Adds a new text_styles table keyed by field_key ("{table}.{slugOrId}.{column}")
so any individual text field anywhere in the dashboard can get its own
font-family/font-size/color override, without a dedicated column per field.
App\Support\TextStyleFields is a server-side registry of which table/column/
permission combinations are valid, so TextStyleController::update() can't be
used to write styling for a field outside the caller's own permission domain,
and typos can't create permanently orphaned rows. Resetting all three values
deletes the row entirely rather than leaving it null, so the table only ever
holds fields an admin actually customized.
Font-size reuses the same "curated list, mirrored PHP+JS constant" approach
already used for font-family (App\Support\Fonts / fontOptions.js) - a free px
input on dozens of independently-edited fields with no design review step is
the most likely way to end up with an accidentally 4px or 400px heading.
New reusable pieces: TextStyleWidget.jsx (a self-contained font/size/color
toolbar with a live preview, used next to any field by passing its
field_key) and TextStylesContext.jsx + useTextStyle() hook (bulk-fetches all
styles once per page load in PublicLayout.jsx, same pattern as
SiteSettingsContext). This first phase wires both into the home-section
eyebrow/title/button-label fields (the ones from the screenshot that started
this) as a proven pilot; the registry is designed so extending it to the
remaining ~15 admin pages is just adding entries and wiring the widget/hook,
no new architecture.
Verified locally via direct PHP invocation: migration creates the table,
registry validation accepts only known table/slug-or-id/column
combinations and rejects the rest, upsert/reset round-trips correctly, and
a second migration run doesn't re-touch anything.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
53 lines
2.8 KiB
HTML
53 lines
2.8 KiB
HTML
<!doctype html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||
<!-- Nur fuer die Paket-Kacheln auf der Modell-Seite (Name/Preis-Typografie im
|
||
Kunden-Referenzdesign) - der Rest der Seite bleibt beim Standard-Font. -->
|
||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@500;600&family=Michroma&display=swap" rel="stylesheet" />
|
||
<title>HifiPlanet | Car-Hifi Umbauten nach Maß</title>
|
||
<meta name="description" content="HifiPlanet – dein Car-Hifi Spezialist. Marke und Modell wählen, passende Sound-Pakete entdecken und unverbindlich anfragen." />
|
||
<link rel="canonical" href="https://hifi-planet.de/" />
|
||
|
||
<meta property="og:type" content="website" />
|
||
<meta property="og:site_name" content="HifiPlanet" />
|
||
<meta property="og:title" content="HifiPlanet | Car-Hifi Umbauten nach Maß" />
|
||
<meta property="og:description" content="Dein Car-Hifi Spezialist: Marke und Modell wählen, passende Sound-Pakete entdecken und unverbindlich anfragen." />
|
||
<meta property="og:locale" content="de_DE" />
|
||
<meta name="twitter:card" content="summary" />
|
||
|
||
<script type="application/ld+json">
|
||
{
|
||
"@context": "https://schema.org",
|
||
"@type": "AutoRepair",
|
||
"name": "HifiPlanet",
|
||
"description": "Car-Hifi Spezialist für individuelle Sound-Umbauten – vom unauffälligen Upgrade bis zum Komplettumbau.",
|
||
"url": "https://hifi-planet.de/",
|
||
"telephone": "+4993732062390",
|
||
"email": "info@hifi-planet-amorbach.de",
|
||
"address": {
|
||
"@type": "PostalAddress",
|
||
"streetAddress": "Boxbrunner Str. 20a",
|
||
"postalCode": "63916",
|
||
"addressLocality": "Amorbach",
|
||
"addressCountry": "DE"
|
||
},
|
||
"openingHoursSpecification": [
|
||
{ "@type": "OpeningHoursSpecification", "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], "opens": "09:00", "closes": "18:00" },
|
||
{ "@type": "OpeningHoursSpecification", "dayOfWeek": ["Saturday"], "opens": "10:00", "closes": "13:00" }
|
||
],
|
||
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
||
}
|
||
</script>
|
||
<script type="module" crossorigin src="/assets/index-Bcw7aoHB.js"></script>
|
||
<link rel="modulepreload" crossorigin href="/assets/lucide-icons-Cg2IxtAO.js">
|
||
<link rel="stylesheet" crossorigin href="/assets/index-fn7vJl0-.css">
|
||
</head>
|
||
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
||
<div id="root"></div>
|
||
</body>
|
||
</html>
|