File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -115,9 +115,8 @@ body.theme-ayu span.center img, body.theme-ayu center img {
115
115
<!--
116
116
// Monitors the current rustdoc theme and adds `.theme-NAME` to `<body>`
117
117
function initThemeMonitor () {
118
- if (typeof getCurrentValue !== ' function' ||
119
- typeof switchTheme !== ' function' ||
120
- typeof getSystemValue !== ' function' ||
118
+ if (typeof switchTheme !== ' function' ||
119
+ typeof themeStyle !== ' object' ||
121
120
typeof document .body .classList === ' undefined' )
122
121
{
123
122
// Something is wrong, don't do anything
@@ -133,7 +132,9 @@ function initThemeMonitor() {
133
132
document .body .classList .add (currentClassName);
134
133
}
135
134
136
- onApplyTheme (getCurrentValue (" rustdoc-theme" ) || getSystemValue () || " light" );
135
+ var match = themeStyle .href .match (/ ([a-z ] + )\. css$ / );
136
+ var currentStyle = (match && match[1 ]) || " light" ;
137
+ onApplyTheme (currentStyle);
137
138
138
139
// Intercept calls to `switchTheme`
139
140
var originalSwitchTheme = switchTheme;
You can’t perform that action at this time.
0 commit comments