Skip to content

Commit

Permalink
Merge pull request #623 from dannon/fix-stuck-colormode
Browse files Browse the repository at this point in the history
Fix stuck colormode in website
  • Loading branch information
mvdbeek authored Dec 6, 2024
2 parents 1f58fff + 297bd99 commit 490160d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions website/plugins/colorMode.ts
Original file line number Diff line number Diff line change
@@ -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";
});
});

0 comments on commit 490160d

Please sign in to comment.