From 2b3307a319e6466edbf6417b167f4600b807372a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sun, 23 Jun 2024 21:45:42 -0700 Subject: [PATCH] acp toast message has a dark mode now Signed-off-by: Matt Friedman --- adm/style/acp_abbc3.css | 8 ++++++++ adm/style/event/acp_overall_footer_after.html | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/adm/style/acp_abbc3.css b/adm/style/acp_abbc3.css index f3f5cb78..b729b14e 100644 --- a/adm/style/acp_abbc3.css +++ b/adm/style/acp_abbc3.css @@ -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; } diff --git a/adm/style/event/acp_overall_footer_after.html b/adm/style/event/acp_overall_footer_after.html index c0534347..9c9511be 100644 --- a/adm/style/event/acp_overall_footer_after.html +++ b/adm/style/event/acp_overall_footer_after.html @@ -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(); + }); + {% endif %}