feat: theme colors (#1195)
This commit is contained in:
parent
2e79f3aa37
commit
8753a94aae
19 changed files with 298 additions and 35 deletions
|
@ -15,7 +15,7 @@ export default defineNuxtPlugin(() => {
|
|||
const settings = allSettings[handle]
|
||||
if (!settings) { return }
|
||||
|
||||
const html = document.querySelector('html')
|
||||
const html = document.documentElement
|
||||
${process.dev ? 'console.log({ settings })' : ''}
|
||||
|
||||
if (settings.fontSize) {
|
||||
|
@ -28,6 +28,9 @@ export default defineNuxtPlugin(() => {
|
|||
if (settings.zenMode) {
|
||||
html.classList.add('zen')
|
||||
}
|
||||
if (settings.themeColors) {
|
||||
Object.entries(settings.themeColors).map(i => html.style.setProperty(i[0], i[1]))
|
||||
}
|
||||
})()`.trim().replace(/\s*\n+\s*/g, ';'),
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue