File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 12
12
< title > pandas - Python Data Analysis Library</ title >
13
13
< meta charset ="utf-8 ">
14
14
< meta name ="viewport " content ="width=device-width, initial-scale=1, shrink-to-fit=no ">
15
- < link rel ='shortcut icon ' type ='image/x-icon ' href ='{{ base_url }}/static/img/favicon.ico '/>
15
+ < link rel ='shortcut icon ' type ='image/x-icon ' id =' favicon-tag ' href ='{{ base_url }}/static/img/favicon.ico '/>
16
16
< link rel ="stylesheet "
17
17
href ="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css "
18
18
integrity ="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x "
93
93
< script src ="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/js/bootstrap.bundle.min.js "
94
94
integrity ="sha384-gtEjrD/SeCtmISkJkNUaaKMoLD0//ElJ19smozuHV6z3Iehds+3Ulb9Bn9Plx0x4 "
95
95
crossorigin ="anonymous "> </ script >
96
+ < script type ="text/javascript ">
97
+ const faviconTag = document . getElementById ( 'favicon-tag' ) ;
98
+ const matcher = window . matchMedia ( '(prefers-color-scheme:dark)' ) ;
99
+
100
+ const onUpdate = ( ) => {
101
+ if ( matcher . matches ) faviconTag . href = "{{ base_url }}/static/img/favicon_white.ico" ;
102
+ else faviconTag . href = "{{ base_url }}/static/img/favicon.ico" ;
103
+ } ;
104
+
105
+ onUpdate ( ) ;
106
+
107
+ matcher . addEventListener ( 'change' , onUpdate ) ;
108
+ </ script >
96
109
</ body >
97
110
</ html >
You can’t perform that action at this time.
0 commit comments