Replies: 1 comment
-
|
I am going to leave this as a good first issue. I will not be working on this, but this is a good way to get into Lychee code base. https://tailwindcss.com/docs/dark-mode#with-system-theme-support Some inspiration // On page load or when changing themes, best to add inline in `head` to avoid FOUC
document.documentElement.classList.toggle(
"dark",
localStorage.theme === "dark" ||
(!("theme" in localStorage) && window.matchMedia("(prefers-color-scheme: dark)").matches),
);
// Whenever the user explicitly chooses light mode
localStorage.theme = "light";
// Whenever the user explicitly chooses dark mode
localStorage.theme = "dark";
// Whenever the user explicitly chooses to respect the OS preference
localStorage.removeItem("theme");Files to modify are likely to be: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Enhancement
What about three options for Lychee, i.e., light, dark, system?
In system mode, it will follow the os's theme. So that Lychee is light during the day, and dark during the night.
Btw, appreciate the work. Nice project!
Beta Was this translation helpful? Give feedback.
All reactions