Dark/Light Mode Toggle

Is it expected that the sidebar icon does not display unless you have Enable automatic dark mode color scheme checked in your user preferences?

Im not aware of this setting in user preferences or in the site settings. Can you send me a screenshot?

Hey @jordan-vidrine thanks for letting me know, perhaps it is the result of a different plugin.

1 Like

Hmmm

Im not seeing this on meta or my local instance. Do you have access to see what theme components or plugins are installed?

Ah, could just be on my end then:

  • Dark-Light Toggle
  • Welcome Link Banner

There are a couple others but they are currently disabled.

Which version of Discourse are you on?

version 2.9.0.beta14

1 Like

Short answer: yes. The toggle component will enable the dark mode stylesheet, but it does need that stylesheet to be present. If it isnā€™t present, then it canā€™t switch to it, currently. In theory, it could switch to it by making a request to the server to load the stylesheet, but that would make the component a bit more complicated.

This is a recent change, because now the dark/light mode toggler respects the OS dark mode setting. If a user toggles their OS appearance, this componentā€™s setting is reset. (For example, if userā€™s OS is in light mode, they switch to dark mode using the component and then switch the OS to dark mode, the override will be reset. There will be no changes on the siteā€™s color scheme, but if the user then switches the OS back to light mode, the site will follow, it will auto-switch to light mode.)

@jordan-vidrine the ā€œEnable automatic dark mode color schemeā€ checkbox is shown if a) no dark color schemes are marked as ā€œuser-selectableā€ and b) the " default dark mode color scheme" setting is set to something other than ā€œNoneā€.

2 Likes

This option does not exist anymore. It is now navigation menu and set to Legacy here. I do not see the light/dark switcher. And I do not see the switch when I turn to Header Dropdown, too. I did not try Sidebar as I do not want to use the sidebar on our forum (as there a people online I do not want to mock them).

Is it possible to get the switch in Header Dropdown, too? It seems to be one of the two new and not deprecated options (am I right with that assumption?).

@pmusaraj Just had a few users drop a message on our forum that the toggle isnā€™t doing anything for them, we have a default and a dark theme (which can be selected by users), so trying to figure out how to make this simpler for myself/them, not sure what I am missing to make this work by default.

Perhaps I am missing something on how Dark themes are indicated.

1 Like

Can you post a link to your site? Any warnings in the browser console?

2 Likes

Thanks for following up, I sent you a chat msg.

Edit: solved by ensuring that default dark mode color scheme id from the admin panel is set to a dark theme. Thanks! :+1:

3 Likes

@jordan-vidrine Just wanted to ask if you have any plans about this?

2 Likes

Hello. The toggle bottom only shows for admins.
What have I done ? :sweat_smile:

1 Like

Verify under preferences > Interface > Color Scheme that users have a dark mode color scheme chosen. If there is no dark mode selected there, the toggle button wonā€™t render

1 Like

Sorry I missed this.

Which header dropdown are you referring to? The legacy menu (not using sidebar), or the profile menu?

1 Like

Thank you.

I meant Header Dropdown (this is how it is called in the settings of the most current version of Discourse). In my understanding this is one of the two new options for hamburger or sidebar.

But I would also happy if it can appear in the Legacy hamburger menu as well. :wink:

I cannot / donā€™t want to use the sidebar due to layout issues with my customized theme.

2 Likes

Okay so one thought: this should be a core feature.
One stupid ask: where do I find example color schemes, I am horrible with colors, so would love to start off something others made.
And a question: I think I enabled and set up everything the way itā€™s supposed to but I see no toggle.

1 Like

Do you have more than 1 color in this area /admin/customize/colors ?

1 Like

yes, two color schemes

2 Likes