2023-01-14 09:34:53 +00:00
|
|
|
import { fontSizeMap } from '~/constants/options'
|
|
|
|
import { DEFAULT_FONT_SIZE } from '~/constants'
|
|
|
|
|
|
|
|
export default defineNuxtPlugin(() => {
|
|
|
|
const userSettings = useUserSettings()
|
|
|
|
const html = document.querySelector('html')!
|
|
|
|
watchEffect(() => {
|
|
|
|
html.style.setProperty('--font-size', fontSizeMap[userSettings.value.fontSize || DEFAULT_FONT_SIZE])
|
|
|
|
})
|
2023-01-14 10:09:17 +00:00
|
|
|
watchEffect(() => {
|
|
|
|
html.classList.toggle('zen', userSettings.value.zenMode)
|
|
|
|
})
|
2023-01-14 09:34:53 +00:00
|
|
|
})
|