fix: avoid visible leading space in whitespace-pre-line blocks

Render hero subheadline and expired message on one line so Blade indentation is not preserved by whitespace-pre-line.

Made-with: Cursor
This commit is contained in:
2026-04-04 10:34:45 +02:00
parent 6791c8349a
commit 26258c5f8b
2 changed files with 7 additions and 7 deletions

View File

@@ -16,6 +16,8 @@
};
$eyebrow = data_get($c, 'eyebrow_text');
$eyebrowStyle = (string) data_get($c, 'eyebrow_style', 'badge');
$subheadlineRaw = data_get($c, 'subheadline');
$subheadline = is_string($subheadlineRaw) ? trim($subheadlineRaw) : '';
@endphp
<div class="flex w-full flex-col {{ $alignClass }} space-y-4">
@@ -35,9 +37,8 @@
</h1>
@endif
@if ($pageState !== 'expired' && filled(data_get($c, 'subheadline')))
<div class="w-full max-w-none whitespace-pre-line text-[15px] leading-[1.65] text-white sm:text-base sm:leading-relaxed">
{{ trim((string) data_get($c, 'subheadline')) }}
</div>
{{-- Subheadline must sit on one line inside the div: whitespace-pre-line turns Blade indentation into visible leading space. --}}
@if ($pageState !== 'expired' && $subheadline !== '')
<div class="w-full max-w-none whitespace-pre-line text-[15px] leading-[1.65] text-white sm:text-base sm:leading-relaxed">{{ $subheadline }}</div>
@endif
</div>