diff options
Diffstat (limited to 'web_src')
-rw-r--r-- | web_src/js/utils.js | 9 | ||||
-rw-r--r-- | web_src/less/themes/theme-arc-green.less | 1 |
2 files changed, 3 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 diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index 4b60c9410f..3a956e0c78 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -1,6 +1,7 @@ @import "../chroma/dark.less"; :root { + --is-dark-theme: true; --color-primary: #87ab63; --color-primary-dark-1: #93b373; --color-primary-dark-2: #9fbc82; |