mirror of
https://github.com/elk-zone/elk.git
synced 2024-11-22 09:25:24 +03:00
13 lines
450 B
TypeScript
13 lines
450 B
TypeScript
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])
|
|
})
|
|
watchEffect(() => {
|
|
html.classList.toggle('zen', userSettings.value.zenMode)
|
|
})
|
|
})
|