π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Add "colorScheme" property on body element to improve render on dark mode
Smaug6739cdd39f5280b2
diff --git a/frontend/app/components/ThemeToggle.vue b/frontend/app/components/ThemeToggle.vueindex 789ab1f2..07741a69 100644--- a/frontend/app/components/ThemeToggle.vue+++ b/frontend/app/components/ThemeToggle.vue@@ -39,6 +39,7 @@ const toggleColorMode = () => {colorMode.preference = 'light';usePreferences().set('darkMode', false);}+ document.body.style.colorScheme = colorMode.preference;};</script>diff --git a/frontend/app/composables/utils.ts b/frontend/app/composables/utils.tsindex 16b875cd..0b287a78 100644--- a/frontend/app/composables/utils.ts+++ b/frontend/app/composables/utils.ts@@ -38,7 +38,9 @@ export function setAppColor(color: string | number) {document.documentElement.style.setProperty('--primary-bg', `var(--${color}-bg)`);document.documentElement.style.setProperty('--primary-border', `var(--${color}-border)`);- usePreferences().set('darkMode', useColorMode().value === 'dark');+ const colorMode = useColorMode();+ usePreferences().set('darkMode', colorMode.value === 'dark');+ document.body.style.colorScheme = colorMode.preference;}export function debounce<T extends (...args: unknown[]) => void>(fn: T, delay = 500) {diff --git a/frontend/app/pages/dashboard/settings/_views/preferences.vue b/frontend/app/pages/dashboard/settings/_views/preferences.vueindex 83cc02f3..dea4554b 100644--- a/frontend/app/pages/dashboard/settings/_views/preferences.vue+++ b/frontend/app/pages/dashboard/settings/_views/preferences.vue@@ -84,6 +84,7 @@ const options = ref<{ label: string; options: Option[] }[]>([key: 'darkMode',onChange: (option: boolean) => {colorMode.preference = option ? 'dark' : 'light';+ document.body.style.colorScheme = colorMode.preference;},},{