File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,17 +45,14 @@ export class ThemeManagerService {
4545 this . setThemeBodyClasses ( theme === Theme . AUTO ? preferredScheme ( ) : theme ) ;
4646 }
4747
48- // 1. Read theme preferences stored in localStorage
49- // 2. In case when there are no stored user preferences, then read them from device preferences.
5048 private loadThemePreference ( ) : void {
5149 const savedUserPreference = this . getThemeFromLocalStorageValue ( ) ,
52- useTheme = savedUserPreference ?? Theme . AUTO ;
50+ useTheme = savedUserPreference ?? Theme . DARK ;
5351
5452 this . theme . set ( useTheme ) ;
5553 this . setThemeBodyClasses ( useTheme === Theme . AUTO ? preferredScheme ( ) : useTheme ) ;
5654 }
5755
58- // Set theme classes on the body element
5956 private setThemeBodyClasses ( theme : Theme . DARK | Theme . LIGHT ) : void {
6057 const documentClassList = this . document . documentElement . classList ;
6158 if ( theme === Theme . DARK ) {
Original file line number Diff line number Diff line change 1111 const LIGHT_THEME_CLASS_NAME = 'theme-light--mode' ;
1212 const PREFERS_COLOR_SCHEME_DARK = '(prefers-color-scheme: dark)' ;
1313
14- const theme = localStorage . getItem ( THEME_PREFERENCE_LOCAL_STORAGE_KEY ) ?? 'auto ' ;
14+ const theme = localStorage . getItem ( THEME_PREFERENCE_LOCAL_STORAGE_KEY ) ?? 'dark ' ;
1515 const prefersDark = window . matchMedia && window . matchMedia ( PREFERS_COLOR_SCHEME_DARK ) . matches ;
1616 const documentClassList = this . document . documentElement . classList ;
1717
You can’t perform that action at this time.
0 commit comments