fix typo: schema -> scheme

This commit is contained in:
syuilo 2023-06-05 10:55:18 +09:00
parent db623dda22
commit 0cb3c7481c
3 changed files with 7 additions and 7 deletions

View File

@ -116,9 +116,9 @@
}
}
}
const colorSchema = localStorage.getItem('colorSchema');
if (colorSchema) {
document.documentElement.style.setProperty('color-schema', colorSchema);
const colorScheme = localStorage.getItem('colorScheme');
if (colorScheme) {
document.documentElement.style.setProperty('color-scheme', colorScheme);
}
//#endregion

View File

@ -13,7 +13,7 @@ type Keys =
'hashtags' |
'wallpaper' |
'theme' |
'colorSchema' |
'colorScheme' |
'useSystemFont' |
'fontSize' |
'ui' |

View File

@ -60,7 +60,7 @@ export function applyTheme(theme: Theme, persist = true) {
document.documentElement.classList.remove('_themeChanging_');
}, 1000);
const colorSchema = theme.base === 'dark' ? 'dark' : 'light';
const colorScheme = theme.base === 'dark' ? 'dark' : 'light';
// Deep copy
const _theme = deepClone(theme);
@ -83,11 +83,11 @@ export function applyTheme(theme: Theme, persist = true) {
document.documentElement.style.setProperty(`--${k}`, v.toString());
}
document.documentElement.style.setProperty('color-schema', colorSchema);
document.documentElement.style.setProperty('color-scheme', colorScheme);
if (persist) {
miLocalStorage.setItem('theme', JSON.stringify(props));
miLocalStorage.setItem('colorSchema', colorSchema);
miLocalStorage.setItem('colorScheme', colorScheme);
}
// 色計算など再度行えるようにクライアント全体に通知