Skip to content

Commit

Permalink
Fix illegible text color in columns Size and Modified on dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 committed Oct 16, 2018
1 parent 0fca815 commit 6b83ec3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,10 @@
// rgb(118, 118, 118) / #767676
// min. color contrast for normal text on white background according to WCAG AA
sizeColor = Math.round(118-Math.pow((fileData.size/(1024*1024)),2));

if (oc_defaults.themeName === 'themedark') {
sizeColor = Math.abs(sizeColor);
}
} else {
simpleSize = t('files', 'Pending');
}
Expand All @@ -1403,6 +1407,16 @@
if (modifiedColor >= '118') {
modifiedColor = 118;
}
if (oc_defaults.themeName === 'themedark') {
modifiedColor = Math.abs(modifiedColor);

// ensure that the dimmest color is still readable
// rgb(130, 130, 130) / #828282
// min. color contrast for normal text on black background according to WCAG AA
if (modifiedColor < 130) {
modifiedColor = 130;
}
}
var formatted;
var text;
if (mtime > 0) {
Expand Down
1 change: 1 addition & 0 deletions lib/private/Template/JSConfigHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public function getConfig() {
'shortFooter' => $this->defaults->getShortFooter(),
'longFooter' => $this->defaults->getLongFooter(),
'folder' => \OC_Util::getTheme(),
'themeName' => $this->config->getUserValue($uid, 'accessibility', 'theme', false),
]),
"oc_capabilities" => json_encode($capabilities),
];
Expand Down

0 comments on commit 6b83ec3

Please sign in to comment.