@@ -18,7 +18,7 @@ const STORAGE_KEY = 'pdf-tts-theme';
1818 */
1919function getSystemTheme ( ) : Theme {
2020 if ( typeof window === 'undefined' ) return 'light' ;
21-
21+
2222 const prefersDark = window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ;
2323 return prefersDark ? 'dark' : 'light' ;
2424}
@@ -35,7 +35,7 @@ function loadSavedTheme(): Theme {
3535 } catch {
3636 // localStorage might not be available
3737 }
38- return getSystemTheme ( ) ;
38+ return 'dark' ; // Default to dark mode for all users
3939}
4040
4141/**
@@ -45,15 +45,15 @@ function loadSavedTheme(): Theme {
4545function applyTheme ( theme : Theme ) : void {
4646 const root = document . documentElement ;
4747 root . setAttribute ( 'data-theme' , theme ) ;
48-
48+
4949 // Also update meta theme-color for mobile browsers
5050 const metaThemeColor = document . querySelector ( 'meta[name="theme-color"]' ) ;
5151 const colors : Record < Theme , string > = {
5252 light : '#ffffff' ,
5353 dark : '#0f0f23' ,
5454 sepia : '#f5f0e8' ,
5555 } ;
56-
56+
5757 if ( metaThemeColor ) {
5858 metaThemeColor . setAttribute ( 'content' , colors [ theme ] ) ;
5959 }
@@ -103,7 +103,7 @@ export function useTheme() {
103103 // Listen for system theme changes (if user hasn't manually set one)
104104 useEffect ( ( ) => {
105105 const mediaQuery = window . matchMedia ( '(prefers-color-scheme: dark)' ) ;
106-
106+
107107 const handleChange = ( ) => {
108108 // Only auto-switch if user hasn't manually saved a preference
109109 const saved = localStorage . getItem ( STORAGE_KEY ) ;
@@ -137,13 +137,13 @@ export function useTheme() {
137137 const currentIndex = THEME_CYCLE . indexOf ( current ) ;
138138 const nextIndex = ( currentIndex + 1 ) % THEME_CYCLE . length ;
139139 const nextTheme = THEME_CYCLE [ nextIndex ] ;
140-
140+
141141 try {
142142 localStorage . setItem ( STORAGE_KEY , nextTheme ) ;
143143 } catch {
144144 // Ignore storage errors
145145 }
146-
146+
147147 return nextTheme ;
148148 } ) ;
149149 } , [ ] ) ;
0 commit comments