Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis <6653109+artonge@users.noreply.github.com>2022-07-28 12:04:16 +0300
committerGitHub <noreply@github.com>2022-07-28 12:04:16 +0300
commitd2d408bba763accf5873e2a3a0deb8629e0073ac (patch)
tree0596a5bdaf95d58748c6c08e53ae677258d9493d /apps/files
parent472f4cad47f832ac0807ac3c4aa33d60a5bcbf31 (diff)
parente4c825e58305481c4a13c17d18d33fb1267d9ea1 (diff)
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.js7
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)