Skip to content

Commit

Permalink
Rollup merge of rust-lang#63847 - GuillaumeGomez:system-theme-detecti…
Browse files Browse the repository at this point in the history
…on, r=kinnison

[rustdoc] Fix system theme detection

Fixes rust-lang#63830

The problem is that it returns the property "entirely" (so with the quotes in our case). Removing them fixes the issue.

cc @fenhl

r? @kinnison
  • Loading branch information
Centril committed Aug 30, 2019
2 parents b76a558 + fcbbf8d commit 5f07ff7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustdoc/html/static/storage.js
Expand Up @@ -118,7 +118,8 @@ function switchTheme(styleElem, mainStyleElem, newTheme, saveTheme) {
}

function getSystemValue() {
return getComputedStyle(document.documentElement).getPropertyValue('content');
var property = getComputedStyle(document.documentElement).getPropertyValue('content');
return property.replace(/\"\'/g, "");
}

switchTheme(currentTheme, mainTheme,
Expand Down

0 comments on commit 5f07ff7

Please sign in to comment.