Skip to content

Commit

Permalink
acp toast message has a dark mode now
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Friedman <[email protected]>
  • Loading branch information
iMattPro committed Jun 24, 2024
1 parent d83559f commit 2b3307a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
8 changes: 8 additions & 0 deletions adm/style/acp_abbc3.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
color: #333333;
}

.toast.toast-dark {
background: hsl(0, 0%, 20%);
}

.toast.toast-dark .toast-message .toast-text {
color: #ffffff;
}

#abbc3_icons_type {
vertical-align: top;
}
Expand Down
19 changes: 19 additions & 0 deletions adm/style/event/acp_overall_footer_after.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,25 @@
});
});
})(jQuery);

function darkToast() {
const toast = document.getElementById('abbc3-successbox');

if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
toast.classList.add("toast-dark");
} else {
toast.classList.remove("toast-dark");
}
}

// Initial check
darkToast();

// Add event listener to detect changes
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
darkToast();
});

</script>

{% endif %}

0 comments on commit 2b3307a

Please sign in to comment.