rename data-theme to dark-theme

This commit is contained in:
Kay0u 2022-09-06 11:44:55 +02:00 committed by axolotle
parent 7f58d4b0e3
commit 90231ef84d
3 changed files with 4 additions and 8 deletions

View file

@ -7,7 +7,7 @@
:to="{ name: 'home' }" :disabled="waiting"
exact exact-active-class="active"
>
<span v-if="theme == true">
<span v-if="theme">
<img alt="Yunohost logo" src="./assets/logo_light.png" width="40">
</span>
<span v-else>
@ -160,7 +160,7 @@ export default {
this.$store.commit('SET_SPINNER', 'spookycat')
}
document.documentElement.setAttribute('data-theme', localStorage.getItem('theme')) // updates the data-theme attribute
document.documentElement.setAttribute('dark-theme', localStorage.getItem('theme')) // updates the data-theme attribute
}
}
</script>

View file

@ -55,11 +55,9 @@ $font-weight-bold: 500;
--info: #0079c4;
--success: #81c926;
--warning: #ffc107;
--logo-src: "./assets/logo_dark.png";
}
[data-theme="true"] {
[dark-theme="true"] {
/* Variables for dark mode */
--background-color: #222c3c;
--background-color-secondary: #273142;
@ -85,8 +83,6 @@ $font-weight-bold: 500;
--info: #0093ee;
--success: #96bf47;
--warning: #ffc02a;
--logo-src: "./assets/logo_light.png";
}
$purple: #9932cc;

View file

@ -52,7 +52,7 @@ export default {
'SET_THEME' (state, boolean) {
localStorage.setItem('theme', boolean)
state.theme = boolean
document.documentElement.setAttribute('data-theme', boolean)
document.documentElement.setAttribute('dark-theme', boolean)
}
},