File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5353 href ="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&family=Sora:wght@300;400;500;600;700&display=swap "
5454 rel ="stylesheet "
5555 />
56+ <!-- Prevent flash of light mode - apply dark class immediately -->
57+ < script >
58+ ( function ( ) {
59+ const stored = localStorage . getItem ( 'davian-space-theme' ) ;
60+ // Default to dark mode
61+ if ( ! stored || stored === 'dark' ) {
62+ document . documentElement . classList . add ( 'dark' ) ;
63+ }
64+ } ) ( ) ;
65+ </ script >
5666 </ head >
5767 < body class ="antialiased ">
5868 <!-- Structured Data (JSON-LD) for SEO -->
Original file line number Diff line number Diff line change @@ -6,15 +6,14 @@ export const useTheme = () => {
66 const [ theme , setTheme ] = useState ( "dark" ) ;
77
88 useEffect ( ( ) => {
9- // Prefer stored theme, fallback to system preference .
9+ // Prefer stored theme, default to dark mode if not set .
1010 const stored = localStorage . getItem ( STORAGE_KEY ) ;
1111 if ( stored ) {
1212 setTheme ( stored ) ;
13- return ;
13+ } else {
14+ // Default to dark mode
15+ setTheme ( "dark" ) ;
1416 }
15-
16- const prefersDark = window . matchMedia ( "(prefers-color-scheme: dark)" ) . matches ;
17- setTheme ( prefersDark ? "dark" : "light" ) ;
1817 } , [ ] ) ;
1918
2019 useEffect ( ( ) => {
You can’t perform that action at this time.
0 commit comments