summaryrefslogtreecommitdiffstats
path: root/apps/accessibility/src
diff options
context:
space:
mode:
authorJan C. Borchardt <hey@jancborchardt.net>2020-08-11 16:22:43 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2020-08-18 08:33:46 +0200
commitaa16550670d82232e16c9b46f44f74819c4e49cf (patch)
tree880e099b9fc06d48f812557bcf1e907d46a1015a /apps/accessibility/src
parent9809b7722166fa05733bda042bd36d03b0be4704 (diff)
downloadnextcloud-server-aa16550670d82232e16c9b46f44f74819c4e49cf.tar.gz
nextcloud-server-aa16550670d82232e16c9b46f44f74819c4e49cf.zip
Add highcontrast class to body just like with dark theme
Signed-off-by: Jan C. Borchardt <hey@jancborchardt.net>
Diffstat (limited to 'apps/accessibility/src')
-rw-r--r--apps/accessibility/src/Accessibility.vue8
-rw-r--r--apps/accessibility/src/accessibilityoca.js8
2 files changed, 13 insertions, 3 deletions
diff --git a/apps/accessibility/src/Accessibility.vue b/apps/accessibility/src/Accessibility.vue
index fcbc07676c6..4baab2257e0 100644
--- a/apps/accessibility/src/Accessibility.vue
+++ b/apps/accessibility/src/Accessibility.vue
@@ -90,14 +90,18 @@ export default {
// SELECT handlers
selectHighContrast(id) {
this.selectItem('highcontrast', id)
+ document.body.classList.toggle('theme--highcontrast')
},
selectTheme(id) {
const previous = this.selected.theme
if (previous) {
- document.body.classList.remove(previous)
+ document.body.classList.remove(`theme--${previous}`)
}
if (id) {
- document.body.classList.add(id)
+ document.body.classList.remove('theme--light')
+ document.body.classList.add(`theme--${id}`)
+ } else {
+ document.body.classList.add('theme--light')
}
this.selectItem('theme', id)
diff --git a/apps/accessibility/src/accessibilityoca.js b/apps/accessibility/src/accessibilityoca.js
index 99d9b714ec4..d4aa18e7c81 100644
--- a/apps/accessibility/src/accessibilityoca.js
+++ b/apps/accessibility/src/accessibilityoca.js
@@ -23,5 +23,11 @@ import { loadState } from '@nextcloud/initial-state'
OCA.Accessibility = loadState('accessibility', 'data')
if (OCA.Accessibility.theme !== false) {
- document.body.classList.add(OCA.Accessibility.theme)
+ document.body.classList.add(`theme--${OCA.Accessibility.theme}`)
+} else {
+ document.body.classList.add('theme--light')
+}
+
+if (OCA.Accessibility.highcontrast !== false) {
+ document.body.classList.add('theme--highcontrast')
}