Automatic Dark Mode Switching for Discourse (iNat Forum)

I do a lot of browsing/forums reading at night, so I use “dark mode” on my devices and on sites that support it. The iNat forum has a dark theme, but it’s a little clunky to click through Profile → Preferences → Interface → Toggle → Save each time I’m browsing at night. I did some searching and it looks like Discourse natively supports automatic light/dark switching based on what mode the user’s device is set to:

https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593/86

It’s been available for awhile (so should be well-tested), and looks like it’s the default for new Discourse installs, but existing installs need to manually enable it in the settings. Looks like you can set it to be unchecked by default, so as to not change existing user experience unexpectedly. Is this something the forum administrators can enable?

Thanks!

3 Likes

Tested this out a bit and I don’t see this option in our Settings - the preference is checked by default. I also don’t see this as an option in the Meta conversation you linked to, unless I’m missing something. Someone asked for the option to have it unchecked but I don’t see a response saying that that was ever implemented.

However, I’d be fine to have the forum automatically switch to dark mode by default and people could opt out if they want.

2 Likes

Thanks, I guess I read that wrong. Was just looking for a way to enable it without changing anyone’s experience suddenly. But I imagine most people who use “dark mode” on their devices are used to this by now since it’s becoming standard behavior.

1 Like

are you looking at the right thing? as i read it, the relevant site setting doesn’t appear to be a checkbox setting. (it’s a selection box.)

from the first section in the original post on that thread (https://meta.discourse.org/t/automatic-dark-mode-color-scheme-switching/161593):

… and you could take this one more step:

there is a caveat noted in the post:

:warning: This brand new feature relies on changes to how themes and color schemes interact. If your site uses a custom theme or unofficial plugins, it is most likely not compatible with automatic dark mode yet.

but it sounds like it might be relatively easy to resolve:

Sites that were previously using Alternative logos per theme can now switch to using the core site settings and remove that component.

1 Like

I can definitely make the forum automatically match your computer’s light/dark setting by default using the default dark mode color scheme id setting, I tried it out briefly a little while ago.

When I switched it on, there was a new option re: dark mode in my account’s Preferences → Interface page that was checked automatically. I didn’t see any setting which would make that preference unchecked by default. That’s what I was referring to, and what I believe @jgw_atx referred to in the OP.

1 Like

i think jgw_atx was saying that that might be a way to implement the site change relatively silently, but i don’t think such a change should be implemented silently.

it should just be implemented, probably with just a quick announcement that it happened and what choices people have, and then folks can switch check or uncheck their automatic switching as they wish.

1 Like

You are probably right. I just know that often there is reluctance to implement even minor UI/UX changes without testing, polling users, etc. and I didn’t want to ask anyone to do a bunch of work just for my personal preference/convenience :) I will say I’m kind of surprised I’m the first one to ask about it though.

I appreciate you looking into it @tiwane

2 Likes

Like I said, I’m happy to switch, I don’t think it’s a big deal, I just wanted to make sure I wasn’t missing anything in regard to making it opt-in or opt-out.

3 Likes

ok. sorry. i was interpreting your earlier posts as if you hadn’t found the setting to turn on site-wide automatic dark mode. but you’re just trying to clarify the one thing from the original request that couldn’t be addressed. so all is good.

looking forward to automatic switching whenever you can make it so.

UPDATE: it looks like the change has been implemented. thanks!

1 Like

OK, it’s been implemented. You’ll have to refresh any pages in order for it to be enabled.

2 Likes