Open 2bndy5 opened 1 year ago
hardcoded colors that could be made agnostic of BG color:
The following is subject to #733: https://github.com/spatialaudio/nbsphinx/blob/a619a5091c29815c1605166d6adca26700fae6e9/src/nbsphinx/_static/nbsphinx-code-cells.css_t#L130
Thanks for reporting this!
nbsphinx
is not supporting dark themes yet (see also #635).
I would like to fix this at some point, but I'm still too confused about how to do that. Sphinx has hardly any support for a dark theme, and many third party themes use quite different technologies for their dark themes. I think this makes it basically impossible to be working correctly on all themes.
The idea with transparency sounds nice, but I guess it can only be used in a few situation and not as a general strategy, right?
For comparison, this is how the JupyterLab dark theme looks like:
Sphinx has hardly any support for a dark theme
I don't think dark mode is a Sphinx support issue. It can be done with HTML and CSS templates.
many third party themes use quite different technologies for their dark themes
Sort of. From what I've seen, light/dark modes are typically toggled using an attribute on the DOM <body>
. The only thing that is really inconsistent is the name of the attribute that is used.
CSS has a media
feature that can be used to compensate for these scenarios, but it might not fit all themes.
The idea with transparency sounds nice, but I guess it can only be used in a few situation and not as a general strategy, right?
If you absolutely want the color to be opaque, then it is harder to satisfy this. But I would recommend the aforementioned CSS media feature when transparency isn't preferrable.
Changing the foreground color makes sense, but it should really only be done if changing the background color to something opaque (as is done for certain rows of tables in nbsphinx).
I noticed a problem with the furo theme example: The background color for stderr output isn't compatible with the dark scheme:
but using a transparency with slightly increased saturation should remedy that in a consistent way for light or dark schemes:
There are other styles that use opaque hard-coded colors which don't blend well with light and dark schemes. I'll update this thread with other related findings...