Skip to content

Beautiful Open-Source Form Builder

Remove dark mode

Julien Nahuma38f647927b5
diff --git a/resources/js/components/App.vue b/resources/js/components/App.vue
index 59d65392d..b4c2baf38 100644
--- a/resources/js/components/App.vue
+++ b/resources/js/components/App.vue
@@ -102,11 +102,6 @@ export default {
mounted () {
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: {
diff --git a/resources/js/components/Navbar.vue b/resources/js/components/Navbar.vue
index e7f148143..9a323d55e 100644
--- a/resources/js/components/Navbar.vue
+++ b/resources/js/components/Navbar.vue
@@ -120,32 +120,6 @@
</svg>
</button>
</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>
@@ -168,7 +142,6 @@ export default {
data: () => ({
appName: window.config.appName,
- darkModeEnabled: false
}),
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: {
async logout() {
// Log out the user.
@@ -233,10 +193,6 @@ export default {
// Redirect to login.
this.$router.push({name: 'login'})
},
- toggleDarkMode() {
- document.body.classList.toggle('dark')
- this.darkModeEnabled = document.body.classList.contains('dark')
- }
}
}
</script>