Halfmoon is a highly customizable, drop-in Bootstrap replacement. It comes with three built-in core themes, with dark mode support for all themes and components.
I just read through your javascript and saw that you are using cookies for storing the preferred theme. Why not use localStorage?
Cookies and localStorage serve different purposes. Cookies are primarily for reading server-side, localStorage can only be read by the client-side. So the question is, in halfmoon, who needs this data — the client or the server? The answer is the client.
You're wasting bandwidth by sending all the data in each HTTP header by using cookies.
I just read through your javascript and saw that you are using
cookies
for storing the preferred theme. Why not uselocalStorage
?Cookies
andlocalStorage
serve different purposes.Cookies
are primarily for reading server-side,localStorage
can only be read by the client-side. So the question is, in halfmoon, who needs this data — the client or the server? The answer is the client.You're wasting bandwidth by sending all the data in each HTTP header by using cookies.
Is there any compatibility issue? It's pretty much supported everywhere.
See this for more info.
So, by all means move to
localStorage
.