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

@@ -13,19 +13,17 @@ export const useNoteView = (containerClass: string) => {
const { isMobile } = useOverlay(false)
const { stackedNotes, addStackedNote } = useRouteQueryStackedNotes()
const titles = computed(
() =>
stackedNotes.value?.reduce((obj: Record<string, string>, note) => {
if (!note) {
return obj
}
const filePath =
store.files.find((file) => file.sha === note)?.path ?? ''
obj[note] = pathToNotePathTitle(filePath)
const titles = computed(() =>
stackedNotes.value?.reduce((obj: Record<string, string>, note) => {
if (!note) {
return obj
}, {})
}
const filePath = store.files.find((file) => file.sha === note)?.path ?? ''
obj[note] = pathToNotePathTitle(filePath)
return obj
}, {})
)
const unsubscribeLink = noteEventBus.addEventBusListener(

View File

@@ -4,6 +4,5 @@ import { Model } from '@/data/models/Model'
export interface UserSettings extends Model<DataType.UserSettings> {
fontFamily?: string
fontSize?: string
mode?: 'light' | 'dark'
backlink?: boolean
}

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)
})
}