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
956 stars 108 forks source link

Enable dark mode for doxygen \image #95

Closed friedrichatgc closed 1 year ago

friedrichatgc commented 1 year ago

Doxygen can add custom images to the documentation using the \image command. The css is extended to enable dark mode for such images, like already done for the "dot" generated SVG inheritance diagrams.

(Tested only with SVG images defined using the \image command)

jothepro commented 1 year ago

Can you elaborate on how you would use this in practice? At a first glance I don't think it's a good idea to invert all images in a documentation by default.

In the demo page I explicitly marked any image that can be inverted without looking awkward with a custom class. Would this also work for you?

Also, there is an open issue & PR about adding support for the <picture> HTML-tag to Doxygen, which would allow providing separate images for both light & dark mode.

friedrichatgc commented 1 year ago

My plan was to enable this only for SVG (which are mostly used for line drawings where color inversion for dark mode makes a lot sense). SVG is added by doxygen using the tag. Then I detected that older doxygen versions add SVG as tag and added img also to the css. But you are right now it applies also for other image types where color inversion may not be useful.

I'm not a fan of using html tags in the doxygen source code like you have done in the demo page. This even enforces me to use since is not a supported html tag in doxygen. (I also use doxygen's xml output for other purpose which has even more problems with html tags in the source)

But I agree now that I should try to fix this locally in my project instead of adding new styles here (or wait for doxygen extensions like in the noted PR).

Thanks. Closeing this PR.