diff --git a/website/plugins/colorMode.ts b/website/plugins/colorMode.ts new file mode 100644 index 000000000..9f07cf16f --- /dev/null +++ b/website/plugins/colorMode.ts @@ -0,0 +1,10 @@ +// Forces light color mode even if localStorage already contains saved preference. +// `colorMode.preference` setting from `nuxt.config.ts` is not enough in this case. +// xref https://github.com/nuxt/ui/issues/227 +export default defineNuxtPlugin((nuxtApp) => { + const colorMode = useColorMode(); + nuxtApp.hook("app:mounted", () => { + colorMode.preference = "light"; + colorMode.value = "light"; + }); +});