diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2022-09-10 19:26:43 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2022-09-10 19:26:43 +0900 |
| commit | a2a1636c1031e4dd5c60e5a5108386f4716a16a1 (patch) | |
| tree | 00935b52e10c1f02d7e681ac2d09158301251abc /packages/client/src/scripts/theme.ts | |
| parent | Merge branch 'develop' (diff) | |
| parent | 12.119.0 (diff) | |
| download | misskey-a2a1636c1031e4dd5c60e5a5108386f4716a16a1.tar.gz misskey-a2a1636c1031e4dd5c60e5a5108386f4716a16a1.tar.bz2 misskey-a2a1636c1031e4dd5c60e5a5108386f4716a16a1.zip | |
Merge branch 'develop'
Diffstat (limited to 'packages/client/src/scripts/theme.ts')
| -rw-r--r-- | packages/client/src/scripts/theme.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/client/src/scripts/theme.ts b/packages/client/src/scripts/theme.ts index 02ac77b59d..3f55d9ae86 100644 --- a/packages/client/src/scripts/theme.ts +++ b/packages/client/src/scripts/theme.ts @@ -57,6 +57,8 @@ export function applyTheme(theme: Theme, persist = true) { document.documentElement.classList.remove('_themeChanging_'); }, 1000); + const colorSchema = theme.base === 'dark' ? 'dark' : 'light'; + // Deep copy const _theme = JSON.parse(JSON.stringify(theme)); @@ -78,8 +80,11 @@ export function applyTheme(theme: Theme, persist = true) { document.documentElement.style.setProperty(`--${k}`, v.toString()); } + document.documentElement.style.setProperty('color-schema', colorSchema); + if (persist) { localStorage.setItem('theme', JSON.stringify(props)); + localStorage.setItem('colorSchema', colorSchema); } // 色計算など再度行えるようにクライアント全体に通知 |