-
Notifications
You must be signed in to change notification settings - Fork 781
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
Default dark mode #353
Comments
To be honest I don't understand this wish. Duplicate to #253 ... |
Each person has their own unique preferences, and all are acceptable. And i wish the amount of people that have asked for a default dark mode counted and the developer just give people what they want, an "option to optionally toggle default dark mode on" |
#253 is about forcing the dark theme at all times. This issue is about having option to be able to switch the theme meanwhile defaulting to the dark theme.
There's no single truth. There are a lot of major websites enforcing you a single theme but still gives you option to change it, and these websites have professional UX team(s) that come to conclusion that this is the right choice. That's why we customize themes, for different tastes. This theme is one of the best which made it very popular. It's customizable on many levels and I think it should give its community a choice. |
Also the users of this theme are us, not our blog's visitors. I'd love to say: "here is my blog, i like it dark, but you can switch to light if you want, or just set it to follow your system preferences" |
And that's exactly the point. Of course the end-user want's his UI as uniform and polished as possible, and therefore likes integration with the light or dark mode, set by him. But if someone absolutely wants the feature and opens a pull request, I don't mind either, just wanted to express my opinion. |
+1 on this one. Would also like to default to the dark theme on my blog, whilst preserving the option for users to switch it to light if they so desire. This used to be achievable with the I would propose a solution that makes it so the |
FWIW, since this issue doesn't seem to get a lot of activity, I implemented a very ugly hotpatch in my Github workflows. It literally nullifies the logic check to make Hugo always think the system prefers dark mode.
The proper option would be of course to merge #302, but I don't wanna diverge too much from the main branch... |
I've discovered a concise method to accomplish this without making any destructive modifications: Add the following code snippet to the {{- if .Site.Params.defaultTheme -}}
<script>localStorage.getItem('theme') || localStorage.setItem('theme', '{{ .Site.Params.defaultTheme }}');</script>
{{- end -}} |
@rhazdon I see that you reverted back theme toggle logic, button and even all styles with
data-theme=dark
🥳. So the only thing we're missing is the old simple switch onbody
forbaseof
files and a JS fallback.The dark theme looks awesome, community loves it and keeps asking for it. Instead of hacking with duplicating and tinkering with variable files, can we have
defaultTheme
back?#343 is closed so bringing this issue up again in a separate discussion.
The text was updated successfully, but these errors were encountered: