refactor: split header modules

This commit is contained in:
Erzbir
2026-08-07 14:40:37 +08:00
parent 25aeefa980
commit 8076187556
4 changed files with 256 additions and 234 deletions
+22
View File
@@ -0,0 +1,22 @@
export const PREFERENCE_KEYS = Object.freeze({
themeMode: "theme-mode",
colorScheme: "theme-color-scheme",
pixelStyle: "pixel-style"
});
export const PIXEL_STYLE_ATTRIBUTE = "pixel_style";
export function getStoredPreference(key) {
return window.TerminalTheme?.storage
? window.TerminalTheme.storage.get(key)
: localStorage.getItem(key);
}
export function setStoredPreference(key, value) {
if (window.TerminalTheme?.storage) {
window.TerminalTheme.storage.set(key, value);
return;
}
localStorage.setItem(key, value);
}