Gib allen Widgets mit Überschrift dieselben Symbolmöglichkeiten
Deploy Test / test (push) Successful in 3m31s
CI Feature / test (push) Successful in 2m49s
Deploy Test / deploy (push) Successful in 32s

Nach der fünften Sichtung auf luf-test:

- Einheitliche Größenstufen (small, medium, large, xlarge = 2,5 / 3,5 / 5 / 7 rem)
  als Tokens --lf-symbol-* und als HeadingAccent::STEPS. Überschrift,
  Einstieg, Bild und Text, Handlungsaufruf, Fließtext und Merkmalszeile
  verwenden dieselben Schlüssel und Werte. Die früheren Stufen Groß und Sehr
  groß neben dem Absatz waren zur Breite skaliert (bis 7 und 10 rem) und sind
  jetzt fest 5 und 7 rem; neu ist Klein.
- Einstieg und Bild und Text: Größe (symbol_size) und senkrechte Ausrichtung
  (symbol_align) neben dem ganzen Textblock, auch auf Navy und auf dem
  Navy-Einstieg (weiße Scheibe).
- Fließtext: Symbol neben dem Text, Vorgabe Mittel.
- Handlungsaufruf: zusätzlich der Pinselstrich unter der Überschrift.
- Ausrichtung "Oben": die Korrektur der Oberkante rechnet mit der tatsächlichen
  Zeilenhöhe je Widget (Einstieg 1,06, Bild und Text 1,14, Fließtext Source
  Sans 3). Am gerenderten Bild gemessen liegen Symbol und Schrift bei allen
  Widgets auf etwa einen Pixel genau auf einer Linie.
- HeadingAccent::lead() bündelt, was eine Ansicht für Symbol und Absatz braucht.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-24 09:20:58 +01:00
1 parent 90c74ac03d
commit 390d61feaa
18 files changed
+199 -33

No files matched your search

+34
View File
@@ -160,6 +160,40 @@ public function test_an_unknown_alignment_is_rejected_when_saving(): void
}
}
public function test_hero_and_image_text_put_the_symbol_beside_their_whole_text_block(): void
{
$hero = $this->publish('/hero-gross', $this->widget('hero', ['eyebrow' => 'Label', 'heading' => 'Einstieg', 'text' => 'Beschreibung'], ['symbol' => 'schutzschild', 'symbol_size' => 'xlarge', 'symbol_align' => 'bottom'], 'editorial_solid'));
$this->assertMatchesRegularExpression('~<div class="lf-hero__copy">.*?<div class="lf-lead lf-lead--xlarge lf-lead--bottom"><svg[^>]*lf-lead__symbol.*?<div class="lf-lead__body">\s*<p class="lf-hero__eyebrow">Label</p>\s*<h2 class="lf-hero__title">Einstieg</h2>.*?Beschreibung.*?</div></div>~s', $hero);
$this->assertStringNotContainsString('lf-heading-symbol', $hero);
$imageText = $this->publish('/bild-text-gross', $this->widget('image_text', ['title' => 'Ansatz', 'body' => '<p>Text</p>'], ['symbol' => 'buch', 'symbol_size' => 'small', 'symbol_align' => 'center'], 'image_left'));
$this->assertMatchesRegularExpression('~<div class="lf-bt__copy">\s*<div class="lf-lead lf-lead--small lf-lead--center"><svg[^>]*lf-lead__symbol.*?<h2 class="lf-bt__headline">Ansatz</h2>.*?<div class="lf-bt__body"><p>Text</p></div>\s*</div></div>\s*</div>~s', $imageText);
$this->assertStringNotContainsString('lf-heading-symbol', $imageText);
$this->assertStringNotContainsString('lf-lead', $this->publish('/hero-klein', $this->widget('hero', ['heading' => 'Einstieg'], ['symbol' => 'schutzschild'], 'editorial_solid')), 'Ohne Größe bleibt das Symbol klein in der Überschrift.');
}
public function test_the_prose_widget_takes_a_symbol_beside_the_text_with_medium_as_default(): void
{
$plain = $this->publish('/fliesstext-ohne', $this->widget('prose', ['body' => "Erster Absatz.\n\nZweiter Absatz."]));
$this->assertStringNotContainsString('lf-lead', $plain);
$this->assertStringContainsString('<div class="prose">', $plain);
$medium = $this->publish('/fliesstext-symbol', $this->widget('prose', ['body' => 'Text.'], ['symbol' => 'buch']));
$this->assertMatchesRegularExpression('~<div class="lf-lead lf-lead--medium lf-lead--top"><svg[^>]*lf-lead__symbol.*?<div class="lf-lead__body">\s*<div class="prose">\s*<p>Text\.</p>\s*</div>\s*</div></div>~s', $medium);
$this->assertStringContainsString('lf-lead--xlarge lf-lead--center', $this->publish('/fliesstext-gross', $this->widget('prose', ['body' => 'Text.'], ['symbol' => 'buch', 'symbol_size' => 'xlarge', 'symbol_align' => 'center'])));
$this->assertStringNotContainsString('lf-lead', $this->publish('/fliesstext-nur-groesse', $this->widget('prose', ['body' => 'Text.'], ['symbol_size' => 'large'])), 'Ohne Symbol nie ein Absatzlayout.');
}
public function test_the_call_to_action_can_underline_its_heading_with_the_brush(): void
{
$html = $this->publish('/aufruf-pinsel', $this->widget('call_to_action', ['heading' => 'Jetzt', 'label' => 'Los', 'url' => '/angebote'], ['accent' => 'brush']));
$this->assertMatchesRegularExpression('~<h2>Jetzt</h2>\s*<svg[^>]*class="brand-symbol lf-heading-brush"~', $html);
$this->assertStringNotContainsString('lf-heading-brush', $this->publish('/aufruf-ohne', $this->widget('call_to_action', ['heading' => 'Jetzt', 'label' => 'Los', 'url' => '/angebote'])));
}
public function test_the_large_size_does_nothing_without_a_symbol_and_is_checked_when_saving(): void
{
$this->assertStringNotContainsString('lf-lead', $this->publish('/gross-ohne', $this->widget('heading', ['heading' => 'Filme'], ['symbol_size' => 'large'])));