From 2b07b3a873e5693556b56dd310944bf744f7d103 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 26 Sep 2018 18:59:37 +0900 Subject: wip --- src/client/app/boot.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/client/app/boot.js') diff --git a/src/client/app/boot.js b/src/client/app/boot.js index 25aa26dd19..e122e0423a 100644 --- a/src/client/app/boot.js +++ b/src/client/app/boot.js @@ -20,6 +20,16 @@ const langs = LANGS; + //#region Apply theme + const theme = localStorage.getItem('theme'); + if (theme) { + Object.entries(JSON.parse(theme)).forEach(([k, v]) => { + if (k == 'meta') return; + document.documentElement.style.setProperty(`--${k}`, v.toString()); + }); + } + //#endregion + //#region Load settings let settings = null; const vuex = localStorage.getItem('vuex'); @@ -84,13 +94,6 @@ app = isMobile ? 'mobile' : 'desktop'; } - // Dark/Light - if (settings) { - if (settings.device.darkmode) { - document.documentElement.setAttribute('data-darkmode', 'true'); - } - } - // Script version const ver = localStorage.getItem('v') || VERSION; -- cgit v1.3.1-freya