Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode #206

Open
UjuiUjuMandan opened this issue May 21, 2023 · 3 comments
Open

Dark mode #206

UjuiUjuMandan opened this issue May 21, 2023 · 3 comments

Comments

@UjuiUjuMandan
Copy link
Contributor

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

@stevenjoezhang
Copy link
Member

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

@UjuiUjuMandan
Copy link
Contributor Author

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
Copy link
Contributor Author

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants