color cookie
This commit is contained in:
@@ -7,9 +7,12 @@ export function ui_color_cookie(): CookieRef<string> {
|
||||
|
||||
});
|
||||
watch(c, (newVal, oldVal) => {
|
||||
document.body.classList.remove(oldVal);
|
||||
document.body.classList.add(newVal);
|
||||
})
|
||||
// remove old class (if it's been put)
|
||||
if (oldVal != undefined) document.body.classList.remove("ui-" + oldVal);
|
||||
|
||||
// add new class
|
||||
document.body.classList.add("ui-" + newVal);
|
||||
}, { immediate: true})
|
||||
|
||||
return c;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user