Skip to content

Commit d3d4764

Browse files
authored
Merge pull request #101 from kbvernon/callout-margin
chore: add margin to callouts
2 parents a1731e9 + 9b671d2 commit d3d4764

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

templates/shortcodes/callout.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,30 @@
33
{%- set collapse = collapse | default(value=false) -%}
44
{%- set dialog = dialog | default(value=false) -%}
55

6-
{%- if type == "tip" -%}{% set icon = "lucide--lightbulb" %}
7-
{%- elif type == "warning" -%}{% set icon = "lucide--triangle-alert" %}
8-
{%- else -%}{% set icon = "lucide--info" %}
6+
{%- if type == "tip" -%}
7+
{% set icon_img = "lucide--lightbulb" %}
8+
{%- elif type == "warning" -%}
9+
{% set icon_img = "lucide--triangle-alert" %}
10+
{%- else -%}
11+
{% set icon_img = "lucide--info" %}
912
{%- endif -%}
10-
{%- set ico = '<span class="iconify ' ~ icon ~ ' size-5 shrink-0 text-primary"></span>' -%}
13+
{%- set icon = '<span class="iconify ' ~ icon_img ~ ' size-5 shrink-0 text-primary"></span>' -%}
1114

1215
{%- if dialog -%}
1316
{%- set id = id | default(value="callout-dialog-" ~ nth) -%}
1417
<button type="button"
1518
class="bc my-6 w-full flex items-center gap-3 px-4 py-3 rounded-lg border border-border border-l-4 border-l-primary bg-card text-card-foreground text-left cursor-pointer transition-colors hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring focus-visible:outline-offset-2 after:content-['\203A'] after:text-muted-foreground after:text-2xl after:leading-none after:ml-auto"
1619
onclick="document.getElementById('{{ id }}').showModal()">
17-
{{ ico | safe }}
18-
<h2 class="font-semibold text-[0.95rem]/[1.4]">
20+
{{ icon | safe }}
21+
<h2 class="font-semibold text-base">
1922
{{ label }}
2023
</h2>
2124
</button>
2225
<dialog id="{{ id }}" class="dialog bc" aria-labelledby="{{ id }}-title"
2326
onclick="if (event.target === this) this.close()">
2427
<div class="border-l-4 border-l-primary">
2528
<header class="flex items-center gap-3">
26-
{{ ico | safe }}
29+
{{ icon | safe }}
2730
<h2 id="{{ id }}-title">
2831
{{ label }}
2932
</h2>
@@ -38,19 +41,19 @@ <h2 id="{{ id }}-title">
3841
role="note" aria-label="{{ label }}">
3942
<summary
4043
class="list-none cursor-pointer flex items-center gap-3 [&::-webkit-details-marker]:hidden after:content-['\203A'] after:text-muted-foreground after:text-2xl after:leading-none after:ml-auto after:transition-transform group-open:after:rotate-90">
41-
{{ ico | safe }}
42-
<h2 class="font-semibold text-[0.95rem]/[1.4]">{{ label }}</h2>
44+
{{ icon | safe }}
45+
<h2 class="font-semibold text-base">{{ label }}</h2>
4346
</summary>
4447
<section class="mt-2 pl-8 text-muted-foreground text-[0.925rem] [&>:first-child]:mt-0 [&>:last-child]:mb-0">
4548
{{ body | markdown(inline=true) | safe }}
4649
</section>
4750
</details>
4851
{%- else -%}
49-
<div class="bc px-4 py-3 rounded-lg border border-border border-l-4 border-l-primary bg-card text-card-foreground"
52+
<div class="bc px-4 py-3 my-6 border border-border border-l-4 border-l-primary bg-card text-card-foreground"
5053
role="note" aria-label="{{ label }}">
5154
<header class="flex items-center gap-3">
52-
{{ ico | safe }}
53-
<h2 class="font-semibold text-[0.95rem]/[1.4]">
55+
{{ icon | safe }}
56+
<h2 class="font-semibold text-base">
5457
{{ label }}
5558
</h2>
5659
</header>

0 commit comments

Comments
 (0)