-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
1,421 additions
and
1,608 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
export default defineNuxtPlugin((nuxtApp) => { | ||
const themeStore = useTheme() | ||
|
||
// TODO: Temporarily removed as it was causing hydration issues | ||
// nuxtApp.hook('app:mounted', () => { | ||
// if (process.client && themeStore.value.preference === 'system') { | ||
// const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: light)') | ||
// | ||
// const setColorScheme = (e) => { | ||
// if (themeStore.value.preference === 'system') { | ||
// if (e.matches) { | ||
// updateTheme('light') | ||
// } else { | ||
// updateTheme('dark') | ||
// } | ||
// } | ||
// } | ||
// | ||
// setColorScheme(colorSchemeQueryList) | ||
// colorSchemeQueryList.addEventListener('change', setColorScheme) | ||
// } | ||
// }) | ||
nuxtApp.hook('app:mounted', () => { | ||
if (process.client && themeStore.value.preference === 'system') { | ||
const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: light)') | ||
|
||
const setColorScheme = (e) => { | ||
if (themeStore.value.preference === 'system') { | ||
if (e.matches) { | ||
updateTheme('light') | ||
} else { | ||
updateTheme('dark') | ||
} | ||
} | ||
} | ||
|
||
setColorScheme(colorSchemeQueryList) | ||
colorSchemeQueryList.addEventListener('change', setColorScheme) | ||
} | ||
}) | ||
nuxtApp.provide('colorMode', themeStore.value) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.