From dcc412e6bce54f0229ad4fb0b40659508cec0397 Mon Sep 17 00:00:00 2001 From: Harlan Wilton Date: Sun, 12 Nov 2023 00:58:04 +1100 Subject: [PATCH] fix(devtools): dark mode support --- client/app.vue | 30 ++++++++++++++++++----------- client/components/OSectionBlock.vue | 4 ++-- client/components/Source.vue | 8 ++++---- client/composables/rpc.ts | 9 +++++++-- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/client/app.vue b/client/app.vue index be38f539..467e02a4 100644 --- a/client/app.vue +++ b/client/app.vue @@ -2,7 +2,9 @@ import { computed, ref } from 'vue' import type { SitemapDefinition } from '../src/runtime/types' import { loadShiki } from './composables/shiki' +import { colorMode } from './composables/rpc' import { data, refreshSources } from './composables/state' +import { useHead } from '#imports' await loadShiki() @@ -39,6 +41,12 @@ function resolveSitemapOptions(definition: SitemapDefinition) { return options } +useHead({ + htmlAttrs: { + class: () => colorMode.value || '', + }, +}) + const appSourcesExcluded = computed(() => data.value?.runtimeConfig?.excludeAppSources || []) const appSources = computed(() => (data.value?.globalSources || []).filter(s => s.sourceType === 'app')) const userSources = computed(() => (data.value?.globalSources || []).filter(s => s.sourceType === 'user')) @@ -67,9 +75,9 @@ const userSources = computed(() => (data.value?.globalSources || []).filter(s =>
- + - SEO + SEO
@@ -151,7 +159,7 @@ const userSources = computed(() => (data.value?.globalSources || []).filter(s =>