The browsers developers plan to introduce a new CSS class #prefers-color-scheme in their recent Media Queries Level 5 revision. [1][2] This will allow websites to ask the operating system which color scheme it prefers: no-preference | light | dark and then to display the website content adjusted. This obviously requires the support of the underlying system to tell which color scheme it currently uses. [1] https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme [2] https://stuffandnonsense.co.uk/blog/redesigning-your-product-and-website-for-dark-mode
Thanks for your suggestion. However, doesn't that need support in the browser reading the setting or theming? I don't think there's a way for our extension to set a custom media query to tell the website prefer dark mode? There's matchMedia API to query media from JavaScript but there doesn't seem to be a way to write to them or add custom ones.
I'm afraid I don't know about that exactly, but here's what I found out so far: The Firefox 67 seems to implement [1][2] something called > "LookAndFeel::GetInt(LookAndFeel::eIntID_SystemUsesDarkTheme, 0)" which they use to determine which color scheme is used on OSX, Windows and GTK. [3][4] [1] https://github.com/mozilla/gecko-dev/blob/master/widget/LookAndFeel.h [2] https://github.com/mozilla/gecko-dev/blob/master/widget/nsXPLookAndFeel.cpp [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1525775 [4] https://bugzilla.mozilla.org/show_bug.cgi?id=1461538 So I feel this feature request may be closed, as there seems nothing to do to at least support the FireFox 67+ as it uses GTK anyway? Is there something similar for Qt, that may be used in the Falkon browser or other applications like pdf readers? I leave it to you to keep the topic open or to close it. :)
I just checked in Chrome, when I check the "Prefer dark scheme" in kde-gtk-settings I have it use dark UI. I didn't manage to get the media stuff to work, though, despite using Chrome 76 unstable or something. Given Chrome already reads the appropriate setting, it's just a matter of time for it to also support the media query properly. The fact that the GTK settings stuff is a bit separate is obviously an issue but separate from this. We don't have a "dark mode" in KDE applications. What I use in settings to identify them as dark is whether the HSV value of the window color is below 192 :D
Yeah, maybe we just need to have the color schemes set the "I'm a dark theme" bit somehow.
Is 'plasmashell' or 'plasma-browser-integration' the right component?
> We don't have a "dark mode" in KDE applications. I like it how it can be done in MacOS by a toggling hot key [1]. > Is 'plasmashell' or 'plasma-browser-integration' the right component? The title of this report is very specific. Maby I should rename it or open another one, like "introduce an option to set and determine light / dark mode inter alia for CSS #prefers-color-scheme." :) [1] http://osxdaily.com/2019/01/29/toggle-dark-mode-light-mac-via-spotlight/
Could someone change this to "wishlist" please and confirm that this still something generally desired?
I don't think anyone is really interested in it.
Sorry, Firefox seems to support that out of the box in conjunction with out GTK color scheme sync. Not sure about chrome, though.