Enable `prefers-color-scheme` CSS media feature by default

I opened an issue discussing this on the GNOME Gitlab, but clearly no one reads those.

I have a visual disability that leads me to use Dark Mode 24/7, and Dark Mode software support is a major focus area for me.

All modern web browsers support the prefers-color-scheme CSS media feature for automatically choosing between Light Mode and Dark Mode CSS styles.

Right now the GNOME Discourse requires users to create an account, log in, and then go in their site preferences in order to enable the Discourse Dark Mode CSS.

However, it seems like Discourse in particular supprts enabling prefers-color-scheme as the default, while still allowing users to optionally override it.

Because respecting implicit user preferences is more accessible for site visitors with visual disabilities, you should enable this feature if at all possible.

You opened an issue on library-web, which has nothing to do with Discourse.

The issue tracker for Discourse is discourse-web.

Thanks for pointing me in the direction of the Discourse topic; I’ll see if I can configure it appropriately.

Unfortunately, it doesn’t seem to work. You can select a Dark theme from your user preferences, but there’s no automatic switch.

Looking at try.discourse.org, this doesn’t seem to work upstream either; I’d recommend asking on Discourse if there was a regression.

Gitlab’s native search is abjectly terrible, and GNOME’s Gitlab instance is basically invisible to DuckDuckGo, so it’s really hard to find the correct issue tracker for a lot of things, unfortunately. :grimacing:

Looking at the more recent replies to the thread I linked, it sounds prefers-color-scheme might not work with all Discourse “themes”, where a “theme” can support or implement multiple color schemes in a variety of different ways.

If the option appears, but it doesn’t seem to do anything even if you enable it, there’s a Firefox extension you can use to force the prefers-color-scheme media feature to toggle to a particular value, which can be useful for testing. (Similar extensions are probably available for other browsers.)

It looks like you got it to work…? I tried visiting the site logged out, and it’s still using Dark Mode, so… yes?

Glad to know that it worked!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.