Add optional align parameter to accordion items shoortcode. Updated docs.
This commit is contained in:
@@ -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`**
|
||||
|
||||
@@ -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 }}
|
||||
|
||||
Reference in New Issue
Block a user