(getInitialMode());
+const isDark = computed(() => mode.value === 'dark' || (mode.value === 'auto' && systemDark.value));
+
+function applyTheme() {
+ const root = document.documentElement;
+ if (mode.value === 'auto') {
+ root.removeAttribute('data-theme');
+ } else {
+ root.setAttribute('data-theme', mode.value);
+ }
+ root.style.colorScheme = isDark.value ? 'dark' : 'light';
+}
+
+export function setThemeMode(next: ThemeMode) {
+ mode.value = next;
+ localStorage.setItem(KEY, next);
+ applyTheme();
+}
+
+export function initTheme() {
+ applyTheme();
+}
+
+export function useTheme() {
+ return { mode, isDark, setThemeMode };
+}
+
+initTheme();
diff --git a/apps/client/src/main.ts b/apps/client/src/main.ts
index 8223169..ea1fce6 100644
--- a/apps/client/src/main.ts
+++ b/apps/client/src/main.ts
@@ -2,6 +2,7 @@ import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { i18n } from './locales';
+import './composables/useTheme';
import './styles.css';
createApp(App).use(router).use(i18n).mount('#app');
diff --git a/apps/client/src/styles.css b/apps/client/src/styles.css
index 8ee0d27..6f887bf 100644
--- a/apps/client/src/styles.css
+++ b/apps/client/src/styles.css
@@ -23,6 +23,30 @@
--shell-shadow: 0 0 24px rgba(0, 0, 0, 0.24);
}
}
+:root[data-theme='light'] {
+ color-scheme: light;
+ --brand: #1f3864;
+ --brand-2: #2e5496;
+ --bg: #f3f5f9;
+ --card-bg: #fff;
+ --soft-bg: #f6f8fb;
+ --border: #d0d7e2;
+ --text: #1f2937;
+ --muted: #6b7280;
+ --shell-shadow: 0 0 24px rgba(0, 0, 0, 0.04);
+}
+:root[data-theme='dark'] {
+ color-scheme: dark;
+ --brand: #7dd3fc;
+ --brand-2: #5eead4;
+ --bg: #0f172a;
+ --card-bg: #111827;
+ --soft-bg: #1f2937;
+ --border: #334155;
+ --text: #e5e7eb;
+ --muted: #94a3b8;
+ --shell-shadow: 0 0 24px rgba(0, 0, 0, 0.24);
+}
* {
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
diff --git a/apps/client/src/views/Home.vue b/apps/client/src/views/Home.vue
index 94f2d24..aa41188 100644
--- a/apps/client/src/views/Home.vue
+++ b/apps/client/src/views/Home.vue
@@ -3,7 +3,10 @@
{{ t('home.title') }}
{{ t('home.hint') }}
-
+
+
+
+