Browse Source

Merge pull request #33299 from nextcloud/fix/files-dark-color-theme

[files app]: Fix dark color mode detection for filelist
pull/33280/head
Louis 4 years ago
committed by GitHub
parent
commit
d2d408bba7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      apps/files/js/filelist.js

7
apps/files/js/filelist.js

@ -1792,8 +1792,11 @@
td.append(linkElem); td.append(linkElem);
tr.append(td); 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 { try {
var maxContrastHex = window.getComputedStyle(document.documentElement) var maxContrastHex = window.getComputedStyle(document.documentElement)

Loading…
Cancel
Save