diff --git a/frontend/components/global/DetailsSection/DetailsSection.vue b/frontend/components/global/DetailsSection/DetailsSection.vue
index dc56fcc..f8ee495 100644
--- a/frontend/components/global/DetailsSection/DetailsSection.vue
+++ b/frontend/components/global/DetailsSection/DetailsSection.vue
@@ -2,10 +2,10 @@
-
-
+
-
{{ detail.name }}
- -
+
-
diff --git a/frontend/composables/use-preferences.ts b/frontend/composables/use-preferences.ts
index c1e8f66..6c31fec 100644
--- a/frontend/composables/use-preferences.ts
+++ b/frontend/composables/use-preferences.ts
@@ -1,9 +1,41 @@
import { Ref } from "vue";
+export type DaisyTheme =
+ | "light"
+ | "dark"
+ | "cupcake"
+ | "bumblebee"
+ | "emerald"
+ | "corporate"
+ | "synthwave"
+ | "retro"
+ | "cyberpunk"
+ | "valentine"
+ | "halloween"
+ | "garden"
+ | "forest"
+ | "aqua"
+ | "lofi"
+ | "pastel"
+ | "fantasy"
+ | "wireframe"
+ | "black"
+ | "luxury"
+ | "dracula"
+ | "cmyk"
+ | "autumn"
+ | "business"
+ | "acid"
+ | "lemonade"
+ | "night"
+ | "coffee"
+ | "winter";
+
export type LocationViewPreferences = {
showDetails: boolean;
showEmpty: boolean;
editorSimpleView: boolean;
+ theme: DaisyTheme;
};
/**
@@ -17,6 +49,7 @@ export function useViewPreferences(): Ref {
showDetails: true,
showEmpty: true,
editorSimpleView: true,
+ theme: "garden",
},
{ mergeDefaults: true }
);
diff --git a/frontend/composables/use-theme.ts b/frontend/composables/use-theme.ts
new file mode 100644
index 0000000..dff3cc4
--- /dev/null
+++ b/frontend/composables/use-theme.ts
@@ -0,0 +1,42 @@
+import { ComputedRef } from "vue";
+import { DaisyTheme } from "./use-preferences";
+
+export interface UseTheme {
+ theme: ComputedRef;
+ setTheme: (theme: DaisyTheme) => void;
+}
+
+const themeRef = ref("garden");
+
+export function useTheme(): UseTheme {
+ const preferences = useViewPreferences();
+ themeRef.value = preferences.value.theme;
+
+ const setTheme = (newTheme: DaisyTheme) => {
+ preferences.value.theme = newTheme;
+
+ if (htmlEl) {
+ htmlEl.value.setAttribute("data-theme", newTheme);
+ }
+
+ themeRef.value = newTheme;
+ };
+
+ const htmlEl = ref(null);
+
+ onMounted(() => {
+ if (htmlEl.value) {
+ return;
+ }
+
+ htmlEl.value = document.querySelector("html");
+ console.log(htmlEl.value);
+ });
+
+ const theme = computed(() => {
+ console.log(themeRef.value);
+ return themeRef.value;
+ });
+
+ return { theme, setTheme };
+}
diff --git a/frontend/pages/home.vue b/frontend/pages/home.vue
index 278bdf5..f807693 100644
--- a/frontend/pages/home.vue
+++ b/frontend/pages/home.vue
@@ -140,7 +140,7 @@
Import
-
+
Profile
@@ -148,12 +148,12 @@
- {{ stat.value.value }}
+ {{ stat.value.value }}
{{ " " }}
- {{ stat.label }}
+ {{ stat.label }}
diff --git a/frontend/pages/item/[id]/edit.vue b/frontend/pages/item/[id]/edit.vue
index e064803..b1a2d43 100644
--- a/frontend/pages/item/[id]/edit.vue
+++ b/frontend/pages/item/[id]/edit.vue
@@ -283,13 +283,13 @@
-
+
-
-
+
+
{{ item.name }}
- Quantity {{ item.quantity }}
+ Quantity {{ item.quantity }}