Skip to content

Commit 0cd7324

Browse files
committed
docs: smooth detail titles
1 parent eee4905 commit 0cd7324

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/layouts/_shortcodes/details.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- /* Modified version of https://github.com/imfing/hextra/blob/v0.9.7/layouts/shortcodes/details.html */ -}}
2+
{{- $title := .Get "title" | default "" -}}
3+
{{- $closed := eq (.Get "closed") "true" | default false -}}
4+
5+
<details class="last-of-type:hx-mb-0 hx-rounded-lg hx-bg-neutral-50 dark:hx-bg-neutral-800 hx-p-2 hx-mt-4 hx-group" {{ if not $closed }}open{{ end }}>
6+
<summary class="hx-flex hx-items-center hx-cursor-pointer hx-select-none hx-list-none hx-p-1 hx-rounded hx-transition-colors hover:hx-bg-gray-100 dark:hover:hx-bg-neutral-800 before:hx-mr-1 before:hx-inline-block before:hx-transition-transform before:hx-content-[''] dark:before:hx-invert rtl:before:hx-rotate-180 group-open:before:hx-rotate-90">
7+
<span class="hx-text-lg">{{ $title | markdownify }}</span>
8+
</summary>
9+
<div class="hx-p-2 hx-overflow-hidden">
10+
{{ .InnerDeindent | markdownify }}
11+
</div>
12+
</details>

0 commit comments

Comments
 (0)