-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy path_content_modal.html
More file actions
44 lines (41 loc) · 1.96 KB
/
Copy path_content_modal.html
File metadata and controls
44 lines (41 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{% comment %}
Content Modal — centered card for long-form reading.
Reuses the .dialog-modal root class so the shared dialog.js (focus trap,
ESC, initial focus, focus return) applies automatically. Open/close is
CSS-only via :target — no JS required.
Variables:
modal_id (required): Unique id for :target, e.g. "content-modal-1".
title (required): Heading text; referenced by aria-labelledby.
subtitle (optional): Byline / secondary text below the title.
content (required): Pre-rendered safe HTML. Rendered with |safe
inside a .content-modal__prose scope.
prev_url (optional): e.g. "#content-modal-2". Empty = prev disabled.
next_url (optional): e.g. "#content-modal-4". Empty = next disabled.
close_url (optional): defaults to "#_".
Trigger: <a href="#{{ modal_id }}">…</a>
{% endcomment %}
<div class="dialog-modal content-modal" id="{{ modal_id }}">
<a class="dialog-modal__backdrop" href="{{ close_url|default:'#_' }}" tabindex="-1"></a>
<div class="content-modal__container"
role="dialog"
aria-modal="true"
aria-labelledby="{{ modal_id }}-title">
<div class="content-modal__header">
<a class="content-modal__close"
role="button"
href="{{ close_url|default:'#_' }}"
aria-label="Close">
{% include "includes/icon.html" with icon_name="close" icon_size=24 %}
</a>
<h2 class="content-modal__title" id="{{ modal_id }}-title">{{ title }}</h2>
{% include "v3/includes/_carousel_buttons.html" with as_links=True prev_url=prev_url|default:"" next_url=next_url|default:"" only %}
</div>
{% if subtitle %}
<div class="content-modal__subtitle">{{ subtitle }}</div>
{% endif %}
<hr class="content-modal__divider" aria-hidden="true">
<div class="content-modal__body" tabindex="0">
<div class="content-modal__prose">{{ content|safe }}</div>
</div>
</div>
</div>