prune: remove theme in litenote config
This commit is contained in:
@@ -13,19 +13,17 @@ 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
|
|
||||||
}
|
|
||||||
const filePath =
|
|
||||||
store.files.find((file) => file.sha === note)?.path ?? ''
|
|
||||||
|
|
||||||
obj[note] = pathToNotePathTitle(filePath)
|
|
||||||
|
|
||||||
return obj
|
return obj
|
||||||
}, {})
|
}
|
||||||
|
const filePath = store.files.find((file) => file.sha === note)?.path ?? ''
|
||||||
|
|
||||||
|
obj[note] = pathToNotePathTitle(filePath)
|
||||||
|
|
||||||
|
return obj
|
||||||
|
}, {})
|
||||||
)
|
)
|
||||||
|
|
||||||
const unsubscribeLink = noteEventBus.addEventBusListener(
|
const unsubscribeLink = noteEventBus.addEventBusListener(
|
||||||
|
|||||||
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user