diff options
author | Louis <6653109+artonge@users.noreply.github.com> | 2022-07-28 11:04:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 11:04:16 +0200 |
commit | d2d408bba763accf5873e2a3a0deb8629e0073ac (patch) | |
tree | 0596a5bdaf95d58748c6c08e53ae677258d9493d /apps/files | |
parent | 472f4cad47f832ac0807ac3c4aa33d60a5bcbf31 (diff) | |
parent | e4c825e58305481c4a13c17d18d33fb1267d9ea1 (diff) | |
download | nextcloud-server-d2d408bba763accf5873e2a3a0deb8629e0073ac.tar.gz nextcloud-server-d2d408bba763accf5873e2a3a0deb8629e0073ac.zip |
Merge pull request #33299 from nextcloud/fix/files-dark-color-theme
[files app]: Fix dark color mode detection for filelist
Diffstat (limited to 'apps/files')
-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) |