Use localStorage for the selected theme in the docs

This commit is contained in:
Lonami Exo
2018-06-27 10:36:56 +02:00
parent 4be248932d
commit a1799ee74b
2 changed files with 3 additions and 5 deletions

View File

@@ -45,7 +45,7 @@ class DocsWriter:
<link id="style" href="{rel_css}/docs.{def_css}.css" rel="stylesheet">
<script>
document.getElementById("style").href = "{rel_css}/docs."
+ (document.cookie.split(";")[0].split("=")[1] || "{def_css}")
+ (localStorage.getItem("theme") || "{def_css}")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"