Remove dark mode

This commit is contained in:
Julien Nahum 2022-11-25 10:01:43 +01:00
parent 0ef6e0cbdd
commit a38f647927
2 changed files with 0 additions and 49 deletions

View File

@ -102,11 +102,6 @@ export default {
mounted () { mounted () {
this.$loading = this.$refs.loading this.$loading = this.$refs.loading
// Dark mode
if (window.localStorage.getItem('opnform-dark-mode-enabled') === '1' || window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark')
}
}, },
methods: { methods: {

View File

@ -120,32 +120,6 @@
</svg> </svg>
</button> </button>
</a> </a>
<transition name="fade" mode="out-in">
<button v-if="darkModeEnabled" key="sun"
class="text-gray-600 hover:text-blue-600 cursor-pointer p-2 rounded-full rounded-md text-sm dark:bg-white dark:text-black"
@click="toggleDarkMode"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor"
>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"
/>
</svg>
</button>
<button v-else key="moon"
class="cursor-pointer text-gray-600 hover:text-blue-600 p-2 rounded-full rounded-md text-sm text-black"
@click="toggleDarkMode"
>
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24"
stroke="currentColor"
>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z"
/>
</svg>
</button>
</transition>
</div> </div>
</div> </div>
</div> </div>
@ -168,7 +142,6 @@ export default {
data: () => ({ data: () => ({
appName: window.config.appName, appName: window.config.appName,
darkModeEnabled: false
}), }),
computed: { computed: {
@ -208,19 +181,6 @@ export default {
} }
}, },
watch: {
darkModeEnabled: {
handler(val) {
window.localStorage.setItem('opnform-dark-mode-enabled', val ? 1 : 0)
},
deep: true
}
},
mounted() {
this.darkModeEnabled = document.body.classList.contains('dark')
},
methods: { methods: {
async logout() { async logout() {
// Log out the user. // Log out the user.
@ -233,10 +193,6 @@ export default {
// Redirect to login. // Redirect to login.
this.$router.push({name: 'login'}) this.$router.push({name: 'login'})
}, },
toggleDarkMode() {
document.body.classList.toggle('dark')
this.darkModeEnabled = document.body.classList.contains('dark')
}
} }
} }
</script> </script>