summaryrefslogtreecommitdiffstats
path: root/web_src/js/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/utils.js')
-rw-r--r--web_src/js/utils.js9
1 files changed, 2 insertions, 7 deletions
diff --git a/web_src/js/utils.js b/web_src/js/utils.js
index 6310b2cb99..86a64b8b75 100644
--- a/web_src/js/utils.js
+++ b/web_src/js/utils.js
@@ -26,13 +26,8 @@ export function isObject(obj) {
// returns whether a dark theme is enabled
export function isDarkTheme() {
- if (document.documentElement.classList.contains('theme-auto')) {
- return window.matchMedia('(prefers-color-scheme: dark)').matches;
- }
- if (document.documentElement.classList.contains('theme-arc-green')) {
- return true;
- }
- return false;
+ const style = window.getComputedStyle(document.documentElement);
+ return style.getPropertyValue('--is-dark-theme').trim().toLowerCase() === 'true';
}
// removes duplicate elements in an array