Skip to content
Snippets Groups Projects
Unverified Commit aa165506 authored by Jan C. Borchardt's avatar Jan C. Borchardt Committed by John Molakvoæ (skjnldsv)
Browse files

Add highcontrast class to body just like with dark theme

parent 9809b772
No related branches found
No related tags found
No related merge requests found
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -90,14 +90,18 @@ export default { ...@@ -90,14 +90,18 @@ export default {
// SELECT handlers // SELECT handlers
selectHighContrast(id) { selectHighContrast(id) {
this.selectItem('highcontrast', id) this.selectItem('highcontrast', id)
document.body.classList.toggle('theme--highcontrast')
}, },
selectTheme(id) { selectTheme(id) {
const previous = this.selected.theme const previous = this.selected.theme
if (previous) { if (previous) {
document.body.classList.remove(previous) document.body.classList.remove(`theme--${previous}`)
} }
if (id) { 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) this.selectItem('theme', id)
......
...@@ -23,5 +23,11 @@ import { loadState } from '@nextcloud/initial-state' ...@@ -23,5 +23,11 @@ import { loadState } from '@nextcloud/initial-state'
OCA.Accessibility = loadState('accessibility', 'data') OCA.Accessibility = loadState('accessibility', 'data')
if (OCA.Accessibility.theme !== false) { 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')
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment