hexo-theme-landscape icon indicating copy to clipboard operation
hexo-theme-landscape copied to clipboard

Dark mode

Open UjuiUjuMandan opened this issue 1 year ago • 3 comments

It will be best if the default theme has a dark mode, and auto switching between dark and light due to system settings.

UjuiUjuMandan avatar May 21 '23 16:05 UjuiUjuMandan

You can try this one: https://github.com/sandoche/Darkmode.js Change color scheme of this theme may require many human effort

stevenjoezhang avatar May 22 '23 12:05 stevenjoezhang

You can try this one: https://github.com/sandoche/Darkmode.js Change color scheme of this theme may require many human effort

Excuse me, but how to put this in use in hexo build process?

UjuiUjuMandan avatar May 22 '23 12:05 UjuiUjuMandan

I tried inserting following code to layout/index.ejs. It looks not very ideal, only the background behind article is black, the article block is still original.

<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script>
<script>
  function addDarkmodeWidget() {
    new Darkmode().showWidget();
  }
  window.addEventListener('load', addDarkmodeWidget);
</script>

UjuiUjuMandan avatar May 22 '23 13:05 UjuiUjuMandan