Skip to content

Commit 60576ef

Browse files
committed
feat: replace modal close button with X icon at top right
1 parent 712df16 commit 60576ef

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

static/css/app.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,12 +1811,18 @@
18111811
.top-0 {
18121812
top: calc(var(--spacing) * 0);
18131813
}
1814+
.top-4 {
1815+
top: calc(var(--spacing) * 4);
1816+
}
18141817
.top-full {
18151818
top: 100%;
18161819
}
18171820
.right-0 {
18181821
right: calc(var(--spacing) * 0);
18191822
}
1823+
.right-4 {
1824+
right: calc(var(--spacing) * 4);
1825+
}
18201826
.right-8 {
18211827
right: calc(var(--spacing) * 8);
18221828
}
@@ -3311,6 +3317,13 @@
33113317
--tw-ease: var(--ease-out);
33123318
transition-timing-function: var(--ease-out);
33133319
}
3320+
.btn-sm {
3321+
@layer daisyui.l1.l2 {
3322+
--fontsize: 0.75rem;
3323+
--btn-p: 0.75rem;
3324+
--size: calc(var(--size-field, 0.25rem) * 8);
3325+
}
3326+
}
33143327
.btn-primary {
33153328
@layer daisyui.l1.l2.l3 {
33163329
--btn-color: var(--color-primary);

templates/includes/announcement_modal.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
{% if latest_announcement %}
77
<dialog id="announcement-modal" class="modal" open>
88
<div class="modal-box bg-cream-1 {% if latest_announcement.modal_size == 'lg' %}w-11/12 max-w-2xl{% elif latest_announcement.modal_size == 'xl' %}w-11/12 max-w-4xl{% endif %}">
9+
<form method="dialog" class="absolute right-4 top-4">
10+
<button class="btn btn-sm btn-ghost"></button>
11+
</form>
912
<h3 class="font-bold text-lg">📢 {{ latest_announcement.title }}</h3>
1013
<div class="py-4">
1114
{{ latest_announcement.content|safe }}
1215
</div>
13-
<div class="modal-action">
14-
<form method="dialog">
15-
<button class="btn">Close</button>
16-
</form>
17-
</div>
1816
</div>
1917
<form method="dialog" class="modal-backdrop">
2018
<button>close</button>

0 commit comments

Comments
 (0)