Skip to content

Commit

Permalink
fix: edtior theme empty when localStroage is not used
Browse files Browse the repository at this point in the history
  • Loading branch information
MR-Addict committed Sep 14, 2024
1 parent a084182 commit 6c3fff9
Show file tree
Hide file tree
Showing 6 changed files with 615 additions and 522 deletions.
2 changes: 1 addition & 1 deletion backend/assets/script.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const lang = replElement.getAttribute("data-lang");
const code = getCode(replElement.nextElementSibling);
const readonly = replElement.getAttribute("data-readonly") === "true";
let theme = mapTheme(localStorage.getItem("mdbook-theme") || "light");
let theme = mapTheme(localStorage.getItem("mdbook-theme") || document.querySelector(".theme.theme-selected")?.id);

const postmessage = (msg) => iframeElement.contentWindow.postMessage({ repl: msg }, "*");

Expand Down
2 changes: 1 addition & 1 deletion docs/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use-default-preprocessors = false
[output.html]
default-theme = "Light"
preferred-dark-theme = "Ayu"
curly-quotes = true
smart-punctuation = true
mathjax-support = true
copy-fonts = true
no-section-label = false
Expand Down
Loading

0 comments on commit 6c3fff9

Please sign in to comment.