Last active
July 28, 2021 23:28
-
-
Save curiositry/f6dc4ea47a9ef27fda162ab226e28b68 to your computer and use it in GitHub Desktop.
Weblog Dark Mode Toggle
This file contains hidden or 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
| /* | |
| Either put this at the end of main.css (to add dark mode toggle in addition to auto-detecting | |
| users preference) or else replace from lines 282-297 of main.css with this snippet | |
| */ | |
| body.dark-theme { | |
| background: #333; | |
| color: #fdfdfd; | |
| } | |
| .dark-theme a { | |
| color: lightblue; | |
| } | |
| .dark-theme .kg-bookmark-container { | |
| background-color: #444; | |
| } |
This file contains hidden or 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
| <button onclick="document.body.classList.toggle('dark-theme')">Toggle Dark Mode</button> | |
| <!-- or --> | |
| <a href="#!" onclick="document.body.classList.toggle('dark-theme')">Toggle Dark Mode</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment