Add TailwindCSS (#1252)

* Setup TailwindCSS

* Fully setup configuration

* Refactor some tailwind variables
This commit is contained in:
Evan Song
2024-07-06 20:57:32 -07:00
committed by GitHub
parent 0f2ddb452c
commit abec2e48d4
176 changed files with 7905 additions and 7433 deletions

View File

@@ -1,27 +1,28 @@
/* eslint-disable no-undef */
export default defineNuxtPlugin(async (nuxtApp) => {
await useAuth()
await useUser()
const themeStore = useTheme()
const cosmetics = useCosmetics()
await useAuth();
await useUser();
const themeStore = useTheme();
const cosmetics = useCosmetics();
nuxtApp.hook('app:mounted', () => {
if (process.client && themeStore.value.preference === 'system') {
const colorSchemeQueryList = window.matchMedia('(prefers-color-scheme: light)')
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 (themeStore.value.preference === "system") {
if (e.matches) {
updateTheme('light')
updateTheme("light");
} else {
updateTheme(cosmetics.value.preferredDarkTheme ?? 'dark')
updateTheme(cosmetics.value.preferredDarkTheme ?? "dark");
}
}
}
};
setColorScheme(colorSchemeQueryList)
colorSchemeQueryList.addEventListener('change', setColorScheme)
setColorScheme(colorSchemeQueryList);
colorSchemeQueryList.addEventListener("change", setColorScheme);
}
})
});
nuxtApp.provide('colorMode', themeStore.value)
})
nuxtApp.provide("colorMode", themeStore.value);
});