mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 20:36:16 +02:00
theme saved and works
This commit is contained in:
@@ -307,7 +307,8 @@ window.windowMixin = {
|
||||
extensions: [],
|
||||
user: null,
|
||||
wallet: null,
|
||||
payments: []
|
||||
payments: [],
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -317,6 +318,7 @@ window.windowMixin = {
|
||||
document.body.setAttribute('data-theme', newValue)
|
||||
console.log(document.body.getAttribute('data-theme'))
|
||||
console.log(newValue)
|
||||
this.$q.localStorage.set('lnbits.theme', newValue)
|
||||
},
|
||||
toggleDarkMode: function () {
|
||||
this.$q.dark.toggle()
|
||||
@@ -334,6 +336,9 @@ window.windowMixin = {
|
||||
},
|
||||
created: function () {
|
||||
this.$q.dark.set(this.$q.localStorage.getItem('lnbits.darkMode'))
|
||||
if (this.$q.localStorage.getItem('lnbits.theme')){
|
||||
document.body.setAttribute('data-theme', this.$q.localStorage.getItem('lnbits.theme'))
|
||||
}
|
||||
if (window.user) {
|
||||
this.g.user = Object.freeze(window.LNbits.map.user(window.user))
|
||||
}
|
||||
|
@@ -29,7 +29,7 @@ $themes: (
|
||||
@each $name, $color in $colors {
|
||||
@if $name == 'dark' {
|
||||
[data-theme='#{$theme}'] .q-drawer--dark,
|
||||
body.body--dark [data-theme='#{$theme}'] .q-layout,
|
||||
body[data-theme='#{$theme}'].body--dark,
|
||||
[data-theme='#{$theme}'] .q-menu--dark {
|
||||
background: $color !important;
|
||||
}
|
||||
|
Reference in New Issue
Block a user