FAQ: animate answers open and closed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
elviraandClaude Opus 5.5 committed 2026-10-27 12:19:29 +02:00
1 parent fb239a97cb
commit 87ff1c477f
2 files changed
+21 -1

No files matched your search

+20
View File
@@ -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 {