Kishore Vancheeshwaran
Toggle dark and light mode

After implementing both light and dark modes for styling code block I have been wondering whether it is a good idea to allow my readers to switch between light and dark modes. I can do this in a static mannger based on the readers' prefers-color-scheme option. The challenge arises when I have to provide an option to do this dynamically.

Possible ways of implementing this include

  • toggling with javascript - I need to research how to use JS
  • using highlightjs
    • elisp and orgmode seem to be missing from the available styles
  • atom-one style missing in chroma, chroma is the default style used in Hugo
  • I can maybe use pygments for light and dracula for dark styles for the syntax highlighting

I have a half baked solution which I think I will not be proceeding with for now. I like light mode and I am sticking to that for now.

If you would like to leave a comment, contact me via email.
Post 13/99 - part of 100DaystoOffload