File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4646 <link rel =" preload" href =" {{ '/assets/fonts/SpaceMono-Regular-subset.woff2' | url }}" as =" font" type =" font/woff2" crossorigin >
4747
4848 <script >
49- (function () {
50- var theme = window .localStorage .getItem (" theme" );
51- if (! theme && window . matchMedia ( ' (prefers-color-scheme: dark) ' ). matches ) {
52- document . documentElement . setAttribute ( ' data-theme ' , ' dark' );
53- }
54- else if (theme) document .documentElement .setAttribute (' data-theme' , theme );
55- })();
49+ (function () {
50+ var theme = window .localStorage .getItem (" theme" );
51+ if (theme) document . documentElement . setAttribute ( ' data-theme ' , theme)
52+ else if ( window . matchMedia ( ' (prefers-color-scheme: dark) ' ). matches )
53+ document . documentElement . setAttribute ( ' data-theme ' , ' dark ' );
54+ else document .documentElement .setAttribute (' data-theme' , ' light ' );
55+ })();
5656 </script >
5757
5858
Original file line number Diff line number Diff line change 88 btn . setAttribute ( "aria-pressed" , "false" ) ;
99 }
1010
11-
12- let theme = window . localStorage . getItem ( "theme" ) ;
13- document . documentElement . setAttribute ( 'data-theme' , theme ) ;
14- if ( ! theme ) document . documentElement . setAttribute ( 'data-theme' , 'light' ) ;
15-
1611 document . addEventListener ( 'DOMContentLoaded' , function ( ) {
1712 var switcher = document . getElementById ( 'js-theme-switcher' ) ;
1813 switcher . removeAttribute ( 'hidden' ) ;
2217
2318 // get any previously-chosen themes
2419 var theme = window . localStorage . getItem ( "theme" ) ;
25- if ( ! theme && window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ) {
26- document . documentElement . setAttribute ( 'data-theme' , 'dark' ) ;
27- }
28- else if ( theme ) document . documentElement . setAttribute ( 'data-theme' , theme ) ;
2920
3021 if ( theme == "light" ) {
3122 enableToggle ( light_theme_toggle ) ;
You can’t perform that action at this time.
0 commit comments