color cookie

This commit is contained in:
2025-12-30 15:52:51 +00:00
parent 14c71a07c0
commit 45adb0b137

View File

@@ -0,0 +1,16 @@
import type {CookieRef} from "#app";
export function ui_color_cookie(): CookieRef<string> {
const c = useCookie("ui_color",{
default: () => "green",
});
watch(c, (newVal, oldVal) => {
document.body.classList.remove(oldVal);
document.body.classList.add(newVal);
})
return c;
}