Skip to content
Discussion options

You must be logged in to vote

If I understand correctly, you want to do this for a single page. You could add the following additional JavaScript to the Markdown file of the page, which will set light mode and hide the toggle:

<script>
  document.body.setAttribute("data-md-color-scheme", "default") // set to light scheme
  var palette = document.querySelector("[data-md-component=palette]")
  palette.style.display = "none" // hide palette switcher
</script>

Not beautiful, but it should do the trick. Note that this doesn't work with instant loading. It's possible, but more work to pull off.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@maglietti
Comment options

Answer selected by maglietti
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants