From 65117a7f5fbe433fb9ecb6318e66554781645117 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 29 Dec 2020 10:52:14 +0100 Subject: [PATCH] Default to dark theme --- public/index.html | 2 +- src/components/BootswatchThemeSelect.vue | 4 ++-- src/store/index.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 76dad075..8910c5bc 100644 --- a/public/index.html +++ b/public/index.html @@ -1,5 +1,5 @@ - + diff --git a/src/components/BootswatchThemeSelect.vue b/src/components/BootswatchThemeSelect.vue index 10cdec63..c0bdeabb 100644 --- a/src/components/BootswatchThemeSelect.vue +++ b/src/components/BootswatchThemeSelect.vue @@ -62,7 +62,7 @@ export default Vue.extend({ this.setTheme(e.target.name.trim()); }, toggleNight() { - this.setTheme(this.activeTheme === 'bootstrap_dark' ? 'bootstrap' : 'bootstrap_dark'); + this.setTheme(this.activeTheme === 'bootstrap' ? 'bootstrap_dark' : 'bootstrap'); }, setTheme(themeName) { // If theme is already active, do nothing. @@ -74,7 +74,7 @@ export default Vue.extend({ const bw = Array.from(styles).filter((w) => w.textContent?.includes('bootswatch')); document.documentElement.setAttribute( 'data-theme', - themeName.toLowerCase() === 'bootstrap_dark' ? 'dark' : 'light', + themeName.toLowerCase() === 'bootstrap' ? 'light' : 'dark', ); // Reset all bootswatch styles bw.forEach((style, index) => { diff --git a/src/store/index.ts b/src/store/index.ts index f0edc5f8..51d1eec0 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -26,7 +26,7 @@ export default new Vuex.Store({ if (theme) { return theme.dark; } - return false; + return true; }, getChartTheme(state, getters) { return getters.isDarkTheme ? 'dark' : 'light';