feat: Implement core application layout, global styling, dark mode, and essential UI components.
This commit is contained in:
parent
84e4d478c7
commit
a2ce1d79a2
7 changed files with 87 additions and 67 deletions
10
Frontend-Learner/plugins/theme.client.ts
Normal file
10
Frontend-Learner/plugins/theme.client.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
export default defineNuxtPlugin(() => {
|
||||
// Client-side only theme initialization to prevent flash of wrong theme
|
||||
if (process.client) {
|
||||
const saved = localStorage.getItem('theme')
|
||||
const isDark = saved === 'dark' || (!saved && window.matchMedia('(prefers-color-scheme: dark)').matches)
|
||||
|
||||
// Apply class immediately for Tailwind
|
||||
document.documentElement.classList.toggle('dark', isDark)
|
||||
}
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue