feat: take into account font size (#11)

This commit is contained in:
Julien Calixte
2025-02-11 21:56:07 +01:00
committed by GitHub
parent baf32ce8e5
commit e2285f8128
3 changed files with 6 additions and 0 deletions

View File

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

View File

@@ -20,11 +20,14 @@ export const useUserSettings = () => {
}
const fontFamily = store.userSettings?.fontFamily
const fontSize = store.userSettings?.fontSize
const mode = store.userSettings?.mode
const root = document.documentElement
downloadGoogleFont(fontFamily || DEFAULT_FONT_POLICY)
root.style.setProperty('--font-size', fontSize || '16px')
switch (mode) {
case 'dark':
root.style.setProperty('--font-color', DARK_FONT_COLOR)