Adjust filelist color handling to new dark theme value

Signed-off-by: Julius Härtl <jus@bitgrid.net>
pull/19109/head
Julius Härtl 5 years ago
parent a3780714fe
commit bfaf28452b
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
  1. 11
      apps/files/js/filelist.js

@ -1591,6 +1591,8 @@
td.append(linkElem);
tr.append(td);
var isDarkTheme = OCA.Accessibility && OCA.Accessibility.theme === 'dark'
try {
var maxContrastHex = window.getComputedStyle(document.documentElement)
.getPropertyValue('--color-text-maxcontrast').trim()
@ -1599,10 +1601,7 @@
}
var maxContrast = parseInt(maxContrastHex.substring(1, 3), 16)
} catch(error) {
var maxContrast = OCA.Accessibility
&& OCA.Accessibility.theme === 'themedark'
? 130
: 118
var maxContrast = isDarkTheme ? 130 : 118
}
// size column
@ -1618,7 +1617,7 @@
sizeColor = maxContrast;
}
if (OCA.Accessibility && OCA.Accessibility.theme === 'themedark') {
if (isDarkTheme) {
sizeColor = Math.abs(sizeColor);
// ensure that the dimmest color is still readable
// min. color contrast for normal text on black background according to WCAG AA
@ -1646,7 +1645,7 @@
modifiedColor = maxContrast;
}
if (OCA.Accessibility && OCA.Accessibility.theme === 'themedark') {
if (isDarkTheme) {
modifiedColor = Math.abs(modifiedColor);
// ensure that the dimmest color is still readable

Loading…
Cancel
Save