Fix doxygen-awesome dark mode
Precisely what the title says. CSS scoping for html elements was leaving a fair amount of rules behind, such as those for html.dark-mode elements. Also, some light theme appropriate coloring was tagged as !important. This patch fixes it all.
@hidmic Thanks a lot for the PR :) Which theme did you test it with? I tested it with the pydata theme used in this repo for demo and the changes seems to have impacted the light mode.
@aniketsalve22 Could you please test it with pydata theme used in the demo, rtd-theme and book-theme?
Which theme did you test it with?
I'm using the sphinx-book-theme but without many of the customizations you have in this repo.
Alright. @aniketsalve22 I guess it then makes sense to test the changes without any of our customisations. Also @Maetveis has achieved cool customisations here from which we can draw some inspiration.
AMD docs look pretty too. Don't mind which path we take so long as we can get the dark mode to work.
Great tool BTW.
@aniketsalve22 Just realized we are using sphinx-book-theme for demo as well and not pydata-theme.
I mentioned on #100 that I can with upstreaming my changes, I don't have the time right now, but I can give a brief summary of what I did for the ROCm documentation:
For ROCm documentation the style is applied by a the "rocm-docs" sphinx theme hosted here: https://github.com/ROCm/rocm-docs-core. It is in turn based on sphinx-book-theme.
The PR that added the styling you see was https://github.com/ROCm/rocm-docs-core/pull/36.
The source of extra_stylsheet is doxygen_awesome.css scoped to the doxygen-content class similarly of what doxysphinx does dynamically with sass. To avoid the node dependency, which would have been painful for the many ROCm projects, I instead opted to preprocess the style-sheet and distribute it with our theme.
Tangentially, I did not use sass even for prepocessing as I found it to be slightly wrong (It breaks rules that refer to html and body, we do not simply want to add the class in front of these). That's why I made https://github.com/StreamHPC/simple-css-selector-transform. The idea was to integrate this to doxysphinx, but I ended up just pre-processing the sources in the interest of time.
More importantly I replaced references of html.light-mode with html[data-theme=dark] which is how pydata-sphinx-theme switches the theme, so the doxygen-awesome dark-mode is kept in sync with the rest of the site.
The rest is just slightly different choices compared to the demo in doxysphinx, for example I chose to hide the titles from the doxygen html and instead use the sphinx ones, which I think integrates better with the rest of the site.