From 45adb0b13725e2f93f556cbd226f3ffce549668f Mon Sep 17 00:00:00 2001 From: suricata Date: Tue, 30 Dec 2025 15:52:51 +0000 Subject: [PATCH] color cookie --- app/composables/ui_color.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app/composables/ui_color.ts diff --git a/app/composables/ui_color.ts b/app/composables/ui_color.ts new file mode 100644 index 0000000..42b938d --- /dev/null +++ b/app/composables/ui_color.ts @@ -0,0 +1,16 @@ +import type {CookieRef} from "#app"; + +export function ui_color_cookie(): CookieRef { + + const c = useCookie("ui_color",{ + default: () => "green", + + }); + watch(c, (newVal, oldVal) => { + document.body.classList.remove(oldVal); + document.body.classList.add(newVal); + }) + + return c; + +} \ No newline at end of file