diff options
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 1530787b83a..b5bd1509d9f 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1792,8 +1792,11 @@ td.append(linkElem); tr.append(td); - var enabledThemes = window.OCA?.Theming?.enabledThemes || [] - var isDarkTheme = enabledThemes.join('').indexOf('dark') !== -1 + const enabledThemes = window.OCA?.Theming?.enabledThemes || [] + // Check enabled themes, if system default is selected check the browser + const isDarkTheme = (enabledThemes.length === 0 || enabledThemes[0] === 'default') + ? window.matchMedia('(prefers-color-scheme: dark)').matches + : enabledThemes.join('').indexOf('dark') !== -1 try { var maxContrastHex = window.getComputedStyle(document.documentElement) |