Readthedocs.org: Dark theme

Created on 18 Mar 2018  路  14Comments  路  Source: readthedocs/readthedocs.org

Is there a dark theme?

Support

Most helpful comment

I was hoping this Feature might come along and be available for _all_ projects hosted at readthedocs.io. Currently, my eyes burn reading them.

As for darkreader.org browser extension, I don't load any extensions in my browsers at home. And at work, corporate security policy dissuades it.

All 14 comments

Are you talking about a Sphinx documentation theme? Read the docs itself only produces one theme (https://github.com/rtfd/sphinx_rtd_theme) and it is not exactly a dark theme. However, if you look around I suspect there are dark themes.

Here's an incomplete list of Sphinx themes and what they look like:
https://github.com/rtfd/rtd-sphinx-themes-examples

I mean for readthedocs?

There isn't. However, there is some significant UI changes in the works. While I can't promise anything, would you be looking for?

Sure :D

Theres this Stylish theme: https://userstyles.org/styles/142968/readthedocs

You could ask the author in the comments if you can use his css and include it as custom CSS(an official dark theme would still be better ^^)

Closing this as a feature we likely wouldn't maintain. We are already bad enough at maintaining our styles, two would be infinitely harder for us to do well.

conf.py:

html_css_files = [
    'css/rtd_dark.css',
]

rtd_dark-20190726-1417.zip

I was hoping this Feature might come along and be available for _all_ projects hosted at readthedocs.io. Currently, my eyes burn reading them.

As for darkreader.org browser extension, I don't load any extensions in my browsers at home. And at work, corporate security policy dissuades it.

@jtmoon79 this is a closed issue. We already decided that we are not going to implement this feature. On the other hand, most of modern web browser come with a "Reading mode" where you can configure a dark mode there.

conf.py:

html_css_files = [
    'css/rtd_dark.css',
]

rtd_dark-20200527-1037.zip

Userstyles.org barely works these days, and the style up on there was pretty nasty to actually use.

I did a bunch of mods to make it darker and redo the syntax highlight (at least for PHP, which is what I was looking at) and the result is on this Gist, in case anyone wants to use it with the Stylus browser extension:

https://gist.github.com/jerclarke/47665e0302bb54ac1688153dd8ff4db1

As a user, I also love to see a global dark-mode toggle built in to all utility sites like RTD. It's a lot simpler to "make it dark" than to add actual "custom themes". Luckily we can do it for ourselves and be patient :)

Using this on a project. https://darkreader.org/ extension for Chrome worked. Very excellent. Although I agree that every GUI should have a dark mode switch. That said when there is tech like this chrome extension, perhaps the world will develop more rapidly and extensions will become the standard to solve this issue.

https://pillow.readthedocs.io/ uses sphinx_rtd_theme and now has dark mode! I used the Dark Reader extension, exported the CSS, wrapped it in @media (prefers-color-scheme: dark) { ... } and added to our config.

See https://github.com/python-pillow/Pillow/pull/4968 for details (which also includes a bit of tweaking for black-on-white/transparent images that others can omit).

(Crossposted at https://github.com/readthedocs/sphinx_rtd_theme/issues/224#issuecomment-722655021.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cagataycali picture cagataycali  路  4Comments

humitos picture humitos  路  4Comments

JiaweiZhuang picture JiaweiZhuang  路  3Comments

enielse picture enielse  路  4Comments

davidfischer picture davidfischer  路  4Comments