diff --git a/static/theme.ts b/static/theme.ts
index 50ed138..11e4bdb 100644
--- a/static/theme.ts
+++ b/static/theme.ts
@@ -1,32 +1,23 @@
-type Theme = 'system' | 'light' | 'dark'
+type Theme = 'light' | 'dark'
const STORAGE_KEY = 'theme'
const getSavedTheme = (): Theme => {
const raw = localStorage.getItem(STORAGE_KEY)
if (raw === 'light' || raw === 'dark') return raw
- return 'system'
-}
-
-const getEffectiveTheme = (theme: Theme): 'light' | 'dark' => {
- if (theme !== 'system') return theme
- return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
+ return 'dark'
}
const applyTheme = (theme: Theme): void => {
const html = document.documentElement
- if (theme === 'system') {
- html.removeAttribute('data-theme')
- } else {
- html.setAttribute('data-theme', theme)
- }
+ html.setAttribute('data-theme', theme)
localStorage.setItem(STORAGE_KEY, theme)
updateToggleButton(theme)
}
const cycleTheme = (): void => {
const current = getSavedTheme()
- const next: Theme = current === 'system' ? 'light' : current === 'light' ? 'dark' : 'system'
+ const next: Theme = current === 'light' ? 'dark' : 'light'
applyTheme(next)
}
@@ -46,12 +37,8 @@ const updateToggleButton = (theme: Theme): void => {
svg.innerHTML = '