Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/accessibility/js/accessibilityoca.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apps/accessibility/js/accessibilityoca.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions apps/accessibility/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public function injectCss(IUserSession $userSession,
$hash = md5(implode('-', $userValues));
$linkToCSS = $urlGenerator->linkToRoute(self::APP_ID . '.accessibility.getCss', ['md5' => $hash]);
\OCP\Util::addHeader('link', ['rel' => 'stylesheet', 'media' => '(prefers-color-scheme: dark)', 'href' => $linkToCSS]);
\OCP\Util::addScript('accessibility', 'accessibilityoca');
}
}
}
1 change: 1 addition & 0 deletions apps/accessibility/lib/Service/JSDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public function getData() {
}

return [
'checkMedia' => $user === null,
'theme' => $theme,
'highcontrast' => $highcontrast,
];
Expand Down
5 changes: 5 additions & 0 deletions apps/accessibility/src/accessibilityoca.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
import { loadState } from '@nextcloud/initial-state'

OCA.Accessibility = loadState('accessibility', 'data')
if (OCA.Accessibility.checkMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
// Overwrite the theme for Guests based on the prefers-color-scheme
OCA.Accessibility.theme = 'dark'
}

if (OCA.Accessibility.theme !== false) {
document.body.classList.add(`theme--${OCA.Accessibility.theme}`)
} else {
Expand Down
5 changes: 1 addition & 4 deletions core/templates/filepicker.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ <h2>{emptytext}</h2>
<span class="filename-parts__last">{filename2}</span>
</span>
</td>
<td class="filesize"
style="color:rgb({sizeColor}, {sizeColor}, {sizeColor})">
{size}
</td>
<td class="filesize">{size}</td>
<td class="date">{date}</td>
</tr>
</tbody>
Expand Down