feat: add fontFamilies array
This commit is contained in:
@@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user