File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,16 @@ document.addEventListener('DOMContentLoaded', function() {
4
4
var mode = ( isDay ? "Day" : "Night" ) ;
5
5
localStorage . setItem ( "css-mode" , mode ) ;
6
6
7
- var daysheet = $ ( 'link[href="_static/pygments.css"]' ) [ 0 ] . sheet ;
7
+ var url_root = DOCUMENTATION_OPTIONS . URL_ROOT == "./" ? "" : DOCUMENTATION_OPTIONS . URL_ROOT ;
8
+ var daysheet = $ ( `link[href="${ url_root } _static/pygments.css"]` ) [ 0 ] . sheet ;
8
9
daysheet . disabled = ! isDay ;
9
10
10
- var nightsheet = $ ( ' link[href="_static/css/dark.css"]' ) [ 0 ] ;
11
+ var nightsheet = $ ( ` link[href="${ url_root } _static/css/dark.css"]` ) [ 0 ] ;
11
12
if ( ! isDay && nightsheet === undefined ) {
12
13
var element = document . createElement ( "link" ) ;
13
14
element . setAttribute ( "rel" , "stylesheet" ) ;
14
15
element . setAttribute ( "type" , "text/css" ) ;
15
- element . setAttribute ( "href" , " _static/css/dark.css" ) ;
16
+ element . setAttribute ( "href" , ` ${ url_root } _static/css/dark.css` ) ;
16
17
document . getElementsByTagName ( "head" ) [ 0 ] . appendChild ( element ) ;
17
18
return ;
18
19
}
You can’t perform that action at this time.
0 commit comments