Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add dark theme and ability to switch between light (#101)
Added toggling between themes and set dark by default. **Note:** In dark mode logo logs a bit off. Not sure where it was created, but we could add a white outline to the text or just have an alt white text version of a logo.
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<button class="btn js-toggle-dark-mode">☼</button> | ||
|
||
<script> | ||
const toggleDarkMode = document.querySelector(".js-toggle-dark-mode"); | ||
|
||
jtd.addEvent(toggleDarkMode, "click", function () { | ||
if (jtd.getTheme() === "light") { | ||
jtd.setTheme("dark"); | ||
toggleDarkMode.textContent = "☼"; | ||
} else { | ||
jtd.setTheme("light"); | ||
toggleDarkMode.textContent = "☾"; | ||
} | ||
}); | ||
</script> |