File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
frontend/src/lib/components Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 33 import { Button } from ' bits-ui' ;
44 import { MoonIcon , SunIcon } from ' lucide-svelte' ;
55
6- let theme = $state ((browser && localStorage . getItem ( ' color-scheme ' )) || ' light' );
6+ let theme = $state (' light' );
77
88 if (browser) {
99 const preference = window .matchMedia (' (prefers-color-scheme: dark)' );
1212 theme = ' dark' ;
1313 }
1414
15+ console .log (localStorage .getItem (' color-scheme' ));
16+
17+ theme = localStorage .getItem (' color-scheme' ) || theme;
18+
1519 setTheme ();
1620
1721 preference .addEventListener (' change' , (mediaQuery ) => {
3943
4044<svelte:head >
4145 <script type =" module" >
42- let theme = localStorage .getItem (' color-scheme' ) || ' light' ;
46+ let theme = ' light' ;
47+
4348 const preference = window .matchMedia (' (prefers-color-scheme: dark)' );
4449
4550 if (preference .matches ) {
4651 theme = ' dark' ;
4752 }
4853
54+ theme = localStorage .getItem (' color-scheme' ) || theme;
55+
56+ console .log (' Theme' , theme);
4957 document .documentElement .setAttribute (' data-color-scheme' , theme);
5058 localStorage .setItem (' color-scheme' , theme);
5159 </script >
You can’t perform that action at this time.
0 commit comments