feat: add fontFamilies array

This commit is contained in:
Julien Calixte
2025-07-06 11:07:09 +02:00
parent 5341e6dcf0
commit b2250b2b95
8 changed files with 169 additions and 126 deletions

View File

@@ -1,10 +1,10 @@
import { watchEffect } from 'vue'
import { watchEffect } from "vue"
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { downloadGoogleFont } from '@/utils/downloadGoogleFont'
import { useUserRepoStore } from "@/modules/repo/store/userRepo.store"
import { downloadGoogleFont } from "@/utils/downloadGoogleFont"
const DEFAULT_FONT_POLICY = 'Courier Prime, monospace'
const DEFAULT_FONT_SIZE = '16px'
const DEFAULT_FONT_POLICY = "Courier Prime, monospace"
const DEFAULT_FONT_SIZE = "16px"
export const useUserSettings = () => {
const store = useUserRepoStore()
@@ -16,10 +16,10 @@ export const useUserSettings = () => {
const root = document.documentElement
const fontFamily = store.userSettings?.fontFamily
const fontFamily = store.userSettings?.chosenFontFamily
const fontSize = store.userSettings?.fontSize
downloadGoogleFont(fontFamily || DEFAULT_FONT_POLICY)
root.style.setProperty('--font-size', fontSize || DEFAULT_FONT_SIZE)
root.style.setProperty("--font-size", fontSize || DEFAULT_FONT_SIZE)
})
}