feat: add terminal and simple shortcut system (#16)

This commit is contained in:
Dominic Elm
2024-07-29 14:37:23 +02:00
committed by GitHub
parent d35f64eb1d
commit 8486d85f64
24 changed files with 696 additions and 111 deletions

View File

@@ -8,6 +8,8 @@ export function themeIsDark() {
return themeStore.get() === 'dark';
}
export const DEFAULT_THEME = 'light';
export const themeStore = atom<Theme>(initStore());
function initStore() {
@@ -15,10 +17,10 @@ function initStore() {
const persistedTheme = localStorage.getItem(kTheme) as Theme | undefined;
const themeAttribute = document.querySelector('html')?.getAttribute('data-theme');
return persistedTheme ?? (themeAttribute as Theme) ?? 'light';
return persistedTheme ?? (themeAttribute as Theme) ?? DEFAULT_THEME;
}
return 'light';
return DEFAULT_THEME;
}
export function toggleTheme() {