about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-30 23:08:03 +0200
committerGitHub <noreply@github.com>2019-08-30 23:08:03 +0200
commit5f07ff70870bc976ffdc691f75cf5a710f940c60 (patch)
tree84e4bd630b54d1e04414ab0eacd7b804214905e3 /src
parentb76a5582273da26bf40e8eb4838860270e9e6e63 (diff)
parentfcbbf8d312c01b6287f4011f27ddb953c3182501 (diff)
downloadrust-5f07ff70870bc976ffdc691f75cf5a710f940c60.tar.gz
rust-5f07ff70870bc976ffdc691f75cf5a710f940c60.zip
Rollup merge of #63847 - GuillaumeGomez:system-theme-detection, r=kinnison
[rustdoc] Fix system theme detection

Fixes #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
Diffstat (limited to 'src')
-rw-r--r--src/librustdoc/html/static/storage.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/librustdoc/html/static/storage.js b/src/librustdoc/html/static/storage.js
index 9d30e7ee79b..40a6a156972 100644
--- a/src/librustdoc/html/static/storage.js
+++ b/src/librustdoc/html/static/storage.js
@@ -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,