mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 10:21:55 +00:00
Default to dark theme
This commit is contained in:
parent
d393cd948f
commit
65117a7f5f
|
@ -1,5 +1,5 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en" data-theme="light">
|
<html lang="en" data-theme="dark">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default Vue.extend({
|
||||||
this.setTheme(e.target.name.trim());
|
this.setTheme(e.target.name.trim());
|
||||||
},
|
},
|
||||||
toggleNight() {
|
toggleNight() {
|
||||||
this.setTheme(this.activeTheme === 'bootstrap_dark' ? 'bootstrap' : 'bootstrap_dark');
|
this.setTheme(this.activeTheme === 'bootstrap' ? 'bootstrap_dark' : 'bootstrap');
|
||||||
},
|
},
|
||||||
setTheme(themeName) {
|
setTheme(themeName) {
|
||||||
// If theme is already active, do nothing.
|
// 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'));
|
const bw = Array.from(styles).filter((w) => w.textContent?.includes('bootswatch'));
|
||||||
document.documentElement.setAttribute(
|
document.documentElement.setAttribute(
|
||||||
'data-theme',
|
'data-theme',
|
||||||
themeName.toLowerCase() === 'bootstrap_dark' ? 'dark' : 'light',
|
themeName.toLowerCase() === 'bootstrap' ? 'light' : 'dark',
|
||||||
);
|
);
|
||||||
// Reset all bootswatch styles
|
// Reset all bootswatch styles
|
||||||
bw.forEach((style, index) => {
|
bw.forEach((style, index) => {
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default new Vuex.Store({
|
||||||
if (theme) {
|
if (theme) {
|
||||||
return theme.dark;
|
return theme.dark;
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
},
|
},
|
||||||
getChartTheme(state, getters) {
|
getChartTheme(state, getters) {
|
||||||
return getters.isDarkTheme ? 'dark' : 'light';
|
return getters.isDarkTheme ? 'dark' : 'light';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user