Halfmoon's in my new personal website redesign - thanks very much! I just had an idea for a (very) small enhancement...
The cookie darkModeOn could perhaps return a boolean true/false value and not "yes" or "no".
We could then check for it in a more intuitive way, like so:
if (halfmoon.readCookie("darkModeOn")) {
// 🌑
} else {
// 🌞
}
This stood out to me because my natural expectation is a boolean value for this, personally.
Maybe this is just a nitpicky opinion thing. Alternatively, maybe instead of darkModeOn the cookie itself could be named mode and then return "light" or "dark"? Any thoughts welcome.
Relevant docs page.
Halfmoon's in my new personal website redesign - thanks very much! I just had an idea for a (very) small enhancement...
The cookie
darkModeOncould perhaps return a boolean true/false value and not"yes"or"no".We could then check for it in a more intuitive way, like so:
This stood out to me because my natural expectation is a boolean value for this, personally.
Maybe this is just a nitpicky opinion thing. Alternatively, maybe instead of
darkModeOnthe cookie itself could be namedmodeand then return"light"or"dark"? Any thoughts welcome.Relevant docs page.