Füge die zentrale Farbpalette und die Hintergrundbreite für Abschnitte hinzu (ADR-67)
- DesignPalette: bis zu zehn benannte Farben (Hintergrund und Schrift) in site_settings, stabile Kennungen, Kontrastprüfung 4,5:1 auf dem Server, Verwendungssuche - Seite Website → Design → Farben (Systemverwalter): Kacheln, Dialog mit Live-Vorschau, Kontrastwarnung mit Empfehlung, Bestätigung mit betroffenen Seiten, Entfernen gesperrt bei Verwendung - Hintergrund „Farbe aus der Palette“ als Verweis im bestehenden Feld background; farbige Kacheln im Editor - Renderer leitet Bedeutungswerte aus Hintergrund und Schrift ab; scope-dark bei heller Schrift - Hintergrundbreite: volle Browserbreite (Vorgabe) oder auf Abschnittsbreite begrenzt - Test sichert die Ausgabe aller bisherigen Varianten byte-gleich; Abnahme mit Screenshots Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
62f3a33541
commit
87de5a62d4
41 files changed
+2372
-14
No files matched your search
@@ -6,6 +6,7 @@
|
||||
use App\Domain\Cms\Widgets\Support\PublicMedia;
|
||||
use App\Domain\Cms\Widgets\WidgetErrors;
|
||||
use App\Domain\Cms\Widgets\WidgetRegistry;
|
||||
use App\Domain\Design\DesignPalette;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
@@ -439,7 +440,7 @@ private function normalizeStyle(array $style, string $prefix, array &$errors): a
|
||||
$enums = SectionStyle::enums();
|
||||
|
||||
foreach ($style as $key => $value) {
|
||||
if ($key === 'image' || str_starts_with((string) $key, '_')) {
|
||||
if (in_array($key, ['image', 'palette_slot'], true) || str_starts_with((string) $key, '_')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -469,6 +470,22 @@ private function normalizeStyle(array $style, string $prefix, array &$errors): a
|
||||
}
|
||||
}
|
||||
|
||||
// Die Breite der Fläche gilt nur mit eigenem Hintergrund.
|
||||
if ($result['background'] === 'default') {
|
||||
unset($result['background_width']);
|
||||
}
|
||||
|
||||
// Farbe aus der Palette: Der Verweis steht nur bei diesem Hintergrund im gespeicherten Stand.
|
||||
if ($result['background'] === 'palette') {
|
||||
$slot = DesignPalette::find($style['palette_slot'] ?? null);
|
||||
|
||||
if ($slot === null) {
|
||||
$errors["$prefix.style.palette_slot"] = ['Bitte eine Farbe aus der Palette wählen. Die gewählte Farbe gibt es nicht (mehr).'];
|
||||
} else {
|
||||
$result['palette_slot'] = $slot['id'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($result['background'] === 'image') {
|
||||
$widgetErrors = new WidgetErrors;
|
||||
$refs = ImageRefFields::clean(['image' => $style['image'] ?? null, '_upload' => $style['_upload'] ?? null], $widgetErrors, errorKey: 'image');
|
||||
|
||||
Reference in new issue
Block a user