You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking about some of our conversations around a "dark theme" in #190 , and it got me wondering if it would be useful to have a "night mode" that only works on code blocks. The Google Cloud docs do this, e.g.:
I think it could be straightforward to accomplish the same thing with a relatively lightweight Sphinx extension that wouldn't need to be a part of this theme. I wonder if folks here think that something like this would be useful?
The text was updated successfully, but these errors were encountered:
Been thinking about this on #273. Moving it out of scope might make sense, but I think if one did switch on a dark page theme, it would be least surprising to get that dark code theme... so they would need to coordinate fairly closely, with no flicker, etc.
Presumably such an extension, e.g. sphinx_live_theming might be able to contain all of the complexity of #273, such that it's a few python-level configuration (and then making CSS variables) to add more theme-y business.
As to implementation: the JS localStorage thing is (basically) unavoidable, even for this, as presumably you'd like it persist between page navigations. Hot-swapping the src on the stylesheet might work, but will possible flicker.
For syntax themes, rather than messing about with variables, it might be automateable to actually manipulate the pygments CSS in-flight, e.g.
/* this is what it normally has */#slt-syntax-zenburn:checked~#slt-main .highlight .c { color:#8f5902; font-style: italic } /* Comment */
Not signing up to do the work at this moment, but there are some interesting paths to consider...
I was thinking about some of our conversations around a "dark theme" in #190 , and it got me wondering if it would be useful to have a "night mode" that only works on code blocks. The Google Cloud docs do this, e.g.:
I think it could be straightforward to accomplish the same thing with a relatively lightweight Sphinx extension that wouldn't need to be a part of this theme. I wonder if folks here think that something like this would be useful?
The text was updated successfully, but these errors were encountered: