mirror of
https://github.com/nextcloud/server.git
synced 2026-06-09 00:32:29 -04:00
Add highcontrast class to body just like with dark theme
Signed-off-by: Jan C. Borchardt <hey@jancborchardt.net>
This commit is contained in:
parent
9809b77221
commit
aa16550670
6 changed files with 17 additions and 7 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue