Skip to content

Commit

Permalink
adding dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
IoTechCrafts committed Aug 23, 2024
1 parent 9adca83 commit c35d57c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions themes/hextra/layouts/shortcodes/dropdown.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- $title := .Get "title" | default "" -}}
{{- $closed := eq (.Get "closed") "true" | default false -}}

<details class="last-of-type:mb-0 rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2 mt-4 group" {{ if not $closed }}open{{ end }}>
<summary class="flex items-center cursor-pointer select-none list-none p-1 rounded transition-colors hover:bg-gray-100 dark:hover:bg-neutral-800 before:mr-1 before:inline-block before:transition-transform before:content-[''] dark:before:invert rtl:before:rotate-180 group-open:before:rotate-90">
<strong class="text-lg">{{ $title | markdownify }}</strong>
</summary>
<div class="p-2 overflow-hidden">
{{ .InnerDeindent | markdownify }}
</div>
</details>

0 comments on commit c35d57c

Please sign in to comment.