edrlab / thorium-reader

A cross platform desktop reading app, based on the Readium Desktop toolkit
https://www.edrlab.org/software/thorium-reader/
BSD 3-Clause "New" or "Revised" License
1.79k stars 154 forks source link

Support OS dark mode #919

Closed kddjenejfkffksd closed 5 months ago

kddjenejfkffksd commented 4 years ago

Dark mode is now available in all three major ARM64 desktop operating systems, Windows, OS X and Ubuntu. As such, apps that do not support this will look out of place, and Thorium is one of them.

Please support OS Dark Mode on Windows, OS X, and Ubuntu, such that the "My Books" menu is dark if the OS dark mode is enabled, and in settings, you could optionally change global theme to be white as usual and dark.

Also, the theme menu within each book would also have to include a "Default" theme, where it displays as Neutral or Dark depending on the preference on the global theme (which is dependent on OS dark mode).

danielweck commented 4 years ago

Related PR (old and obsolete, but contains sound architectural principles, thus why it is still open) https://github.com/readium/readium-desktop/pull/799

danielweck commented 2 years ago

Merged issue: https://github.com/edrlab/thorium-reader/issues/1532

Problem: mismatch between the CSS Media Query prefers-color-scheme: dark and the actual color theme loaded in Thorium.

To reproduce, download the EPUB from: https://standardebooks.org/ebooks/john-muir/my-first-summer-in-the-sierra

...and load in Thorium in an operating system that has "dark mode" activated, but with Thorium using the default "light mode" (i.e. not sepia or dark themes).

@media (prefers-color-scheme: dark)
img[epub|type~="se:image.color-depth.black-on-transparent"] {
    filter: invert(100%);
}

=>

Screenshot 2021-08-27 at 18 33 17

In this case we can disable the CSS filter to see the image:

Screenshot 2021-08-27 at 18 32 26
danielweck commented 5 months ago

Fixed in Thorium3 (system dark/light modes, and publication themes beyond neutral/sepia/night), though I suspect we will get feedback about Windows high contrast, system colour palette (including MacOS which has its own highlight preference), etc.