prune: remove theme in litenote config
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user