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,14 +13,12 @@ export const useNoteView = (containerClass: string) => {
const { isMobile } = useOverlay(false) const { isMobile } = useOverlay(false)
const { stackedNotes, addStackedNote } = useRouteQueryStackedNotes() const { stackedNotes, addStackedNote } = useRouteQueryStackedNotes()
const titles = computed( const titles = computed(() =>
() =>
stackedNotes.value?.reduce((obj: Record<string, string>, note) => { stackedNotes.value?.reduce((obj: Record<string, string>, note) => {
if (!note) { if (!note) {
return obj return obj
} }
const filePath = const filePath = store.files.find((file) => file.sha === note)?.path ?? ''
store.files.find((file) => file.sha === note)?.path ?? ''
obj[note] = pathToNotePathTitle(filePath) obj[note] = pathToNotePathTitle(filePath)

View File

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

View File

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