migrate: switch to callbacks instead of events

This commit is contained in:
Xylight committed 2024-10-26 11:36:31 -07:00
1 parent c7e2963390
commit b291aeebf8
67 files changed
+332 -357

No files matched your search

+23 -20
View File
@@ -77,28 +77,31 @@
themeVars.subscribe((vars) => {
document.body.setAttribute('style', vars)
})
// $effect(() => {
// if (settings) {
// document.body.classList.remove(
// 'font-display',
// 'font-inter',
// 'font-sans',
// 'font-system',
// 'font-nunito',
// )
// document.body.classList.add(
// settings.font == 'inter'
// ? 'font-inter'
// : settings.font == 'system'
// ? 'font-system'
// : settings.font == 'satoshi/nunito'
// ? 'font-nunito'
// : 'font-sans',
// )
// }
// })
}
})
if (browser) {
$effect(() => {
if (settings) {
document.body.classList.remove(
'font-display',
'font-inter',
'font-sans',
'font-system',
'font-nunito',
)
document.body.classList.add(
settings.font == 'inter'
? 'font-inter'
: settings.font == 'system'
? 'font-system'
: settings.font == 'satoshi/nunito'
? 'font-nunito'
: 'font-sans',
)
}
})
}
</script>
<svelte:head>