jothepro / doxygen-awesome-css

Custom CSS theme for doxygen html-documentation with lots of customization parameters.
https://jothepro.github.io/doxygen-awesome-css/
MIT License
981 stars 112 forks source link

Feature Request - force dark/light mode #54

Closed higaski closed 2 years ago

higaski commented 2 years ago

It would be great if dark or light mode could be enforced somehow independently of the system preferences. Transparency or not, having a project with a lot of images from dot or mscgen simply looks better in light mode.

jothepro commented 2 years ago

To get the page to stay in light mode you can remove all @media (prefers-color-scheme: dark) blocks in doxygen-awesome.css. This only works if you don't add the toggle button to your page.

To make it a supported feature that doesn't require you to edit the CSS, I would have to split up the CSS into one for the light mode and one for the dark-mode overwrites. I'm not sure if I like that, I'll think about it... 🤔

jothepro commented 2 years ago

I've figured out that it is enough to just add the class light-mode to the html tag in the header template:

<html xmlns="http://www.w3.org/1999/xhtml" class="light-mode">

This disables the dark mode permanently without the need to modify doxygen-awesome.css. It seems like I already accidentally implemented the requested feature, without knowing. 🙈

Disclaimer: This only works if you don't use the dark-mode toggle extension.

higaski commented 2 years ago

Wahaha that's great. Feature by accident. Thank you! :)

jothepro commented 2 years ago

I've added documentation about how to force light-/dark-mode here

If you run into problems with this approach, pls let me know!

higaski commented 1 year ago

More recent firefox version (at least 107.0) seem to break that feature for whatever reason. :(

Here is a comparison with Chromium 107.0.5304.110 chromium_firefox