prune: remove theme in litenote config

This commit is contained in:
Julien Calixte
2025-02-11 22:21:32 +01:00
parent 4619fcf6da
commit 0f119d1f6a
3 changed files with 15 additions and 36 deletions

View File

@@ -4,12 +4,7 @@ import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { downloadGoogleFont } from '@/utils/downloadGoogleFont'
const DEFAULT_FONT_POLICY = 'Courier Prime, monospace'
const LIGHT_FONT_COLOR = '#4a4a4a'
const LIGHT_BACKGROUND = '#ffffff'
const DARK_FONT_COLOR = '#f7f1e3'
const DARK_BACKGROUND = '#202020'
const DEFAULT_FONT_SIZE = '16px'
export const useUserSettings = () => {
const store = useUserRepoStore()
@@ -19,25 +14,12 @@ export const useUserSettings = () => {
return
}
const fontFamily = store.userSettings?.fontFamily
const fontSize = store.userSettings?.fontSize
const mode = store.userSettings?.mode
const root = document.documentElement
const fontFamily = store.userSettings?.fontFamily
const fontSize = store.userSettings?.fontSize
downloadGoogleFont(fontFamily || DEFAULT_FONT_POLICY)
root.style.setProperty('--font-size', fontSize || '16px')
switch (mode) {
case 'dark':
root.style.setProperty('--font-color', DARK_FONT_COLOR)
root.style.setProperty('--background-color', DARK_BACKGROUND)
break
case 'light':
default:
root.style.setProperty('--font-color', LIGHT_FONT_COLOR)
root.style.setProperty('--background-color', LIGHT_BACKGROUND)
break
}
root.style.setProperty('--font-size', fontSize || DEFAULT_FONT_SIZE)
})
}