Add optional align parameter to accordion items shoortcode. Updated docs.

This commit is contained in:
felix
2026-02-25 20:36:19 +03:00
parent d0a1a5b249
commit 641c16a150
2 changed files with 3 additions and 1 deletions
@@ -116,6 +116,7 @@ The alert sign (`+` or `-`) is optional to control whether the admonition is fol
| `open` | **Optional.** Set to `true` to have the item open by default. |
| `header` | **Optional.** Alias for `title`, kept for compatibility with other shortcodes. |
| `icon` | **Optional.** Icon name to display before the title. |
| `align` | **Optional.** Align text within the item: `left`, `center`, `right` |
<!-- prettier-ignore-end -->
**Example 1: `mode="open"` (multiple items can be open) + `separated=true`**
+2 -1
View File
@@ -10,6 +10,7 @@
{{ $md := .Get "md" | default true }}
{{ $open := .Get "open" | default false }}
{{ $isOpen := or (eq $open true) (eq $open "true") }}
{{ $align := .Get "align" }}
<details
class="{{ if $isSeparated }}rounded-lg border border-neutral-200 dark:border-neutral-700 overflow-hidden{{ else }}border-none{{ end }}"
@@ -27,7 +28,7 @@
{{ partial "icon" "chevron-down" }}
</span>
</summary>
<div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300">
<div class="px-4 pb-4 text-neutral-700 dark:text-neutral-300{{ if $align }} text-{{ $align }}{{ end }}">
{{ if $md }}
{{- .Inner | markdownify -}}
{{ else }}