diff --git a/resources/css/app.css b/resources/css/app.css index 8172a83..0dec220 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -509,6 +509,26 @@ @layer components { .legal-content td { @apply border border-neutral-300 px-3 py-2; } + + /* FAQ answers slide open/closed. ::details-content and interpolate-size + (animating to height: auto) have no utility; browsers without them just + open instantly. User-triggered, so the height change doesn't count + toward CLS. */ + @media (prefers-reduced-motion: no-preference) { + .faq-item { + interpolate-size: allow-keywords; + } + + .faq-item::details-content { + block-size: 0; + overflow-y: clip; + transition: block-size 0.3s ease, content-visibility 0.3s allow-discrete; + } + + .faq-item[open]::details-content { + block-size: auto; + } + } } @keyframes text-dance { diff --git a/resources/views/faq.blade.php b/resources/views/faq.blade.php index b65bef1..4837a20 100644 --- a/resources/views/faq.blade.php +++ b/resources/views/faq.blade.php @@ -72,7 +72,7 @@ class="w-full h-auto lg:sticky lg:top-42" @foreach ($section->items as $faq) @php $number++; @endphp -
+
{{ $faq->name }}