Make chevron rotate

This commit is contained in:
Alex Haslam
2026-02-15 21:55:53 +00:00
parent 43da14b0b3
commit b61ca7359f
2 changed files with 12 additions and 3 deletions
+9
View File
@@ -27,6 +27,15 @@
}
</style>
{{ end }}
<style>
#{{ $id }} details[data-accordion-item] > summary .accordion-chevron {
transform: rotate(-90deg);
transition: transform 200ms ease-in-out;
}
#{{ $id }} details[data-accordion-item][open] > summary .accordion-chevron {
transform: rotate(0deg);
}
</style>
{{ if eq $mode "collapse" }}
<script>
(() => {
+3 -3
View File
@@ -12,7 +12,7 @@
{{ $isOpen := or (eq $open true) (eq $open "true") }}
<details
class="{{ if $isSeparated }}rounded-lg border border-neutral-200 dark:border-neutral-700 overflow-hidden{{ else }}border-none{{ end }}"
class="group {{ if $isSeparated }}rounded-lg border border-neutral-200 dark:border-neutral-700 overflow-hidden{{ else }}border-none{{ end }}"
data-accordion-item
{{ if $isOpen }}open{{ end }}
>
@@ -23,8 +23,8 @@
{{ end }}
<span>{{ $title }}</span>
</span>
<span>
{{ partial "icon" "chevron-down" }}
<span class="accordion-chevron ms-auto flex h-5 w-5 items-center justify-center print:hidden">
{{ partial "icon.html" "chevron-down" }}
</span>
</summary>
<div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300">