Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark theme #3819

Closed
ShalokShalom opened this issue Mar 18, 2018 · 22 comments
Closed

Dark theme #3819

ShalokShalom opened this issue Mar 18, 2018 · 22 comments
Labels
Support Support question

Comments

@ShalokShalom
Copy link

Is there a dark theme?

@davidfischer
Copy link
Contributor

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

@ShalokShalom
Copy link
Author

I mean for readthedocs?

@davidfischer
Copy link
Contributor

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

@ShalokShalom
Copy link
Author

Sure :D

@humitos humitos added the Support Support question label Mar 22, 2018
@SitiSchu
Copy link

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 ^^)

@agjohnson
Copy link
Contributor

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.

@adreyfus
Copy link

adreyfus commented Jul 26, 2019

conf.py:

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

rtd_dark-20190726-1417.zip

@ShalokShalom
Copy link
Author

https://darkreader.org/

@jtmoon79
Copy link

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.

@humitos
Copy link
Member

humitos commented Jan 20, 2020

@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.

@adreyfus
Copy link

adreyfus commented May 27, 2020

conf.py:

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

rtd_dark-20200527-1037.zip

@jerclarke
Copy link

jerclarke commented Nov 2, 2020

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 :)

@MachinesJesus
Copy link

MachinesJesus commented Nov 5, 2020

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.

@hugovk
Copy link
Contributor

hugovk commented Nov 5, 2020

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 python-pillow/Pillow#4968 for details (which also includes a bit of tweaking for black-on-white/transparent images that others can omit).

(Crossposted at readthedocs/sphinx_rtd_theme#224 (comment).)

Edit: Pillow has since switched to Furo: python-pillow/Pillow#6158.

@WhyNotHugo
Copy link

Dark reader has a library which can generate the code. Perhaps the build process could generate and bundle that? It sounds low effort to maintain.

@rohit-kumar-j
Copy link

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 :)

Thanks! This works without any stupid ads like : https://userstyles.org/styles/142968/readthedocs

@ShalokShalom
Copy link
Author

Dark reader has a library which can generate the code. Perhaps the build process could generate and bundle that? It sounds low effort to maintain.

Great idea, sounds awesome

@ErikKalkoken
Copy link

Here is an update to rtd_dark.css that will automatically render yours docs in dark or light mode based on system settings.

https://gist.github.com/ErikKalkoken/0baf538c767774bc11c0e8d4028972e6

@Ahajha
Copy link

Ahajha commented Feb 28, 2023

Just commenting for anyone who might be in my situation: If you're using the dark reader extension and developing docs locally, you have to allow the extension to access local files, otherwise it won't do anything (Yes, this might be a security risk for some, use at your own discretion). If you're reading from a webpage, this won't be an issue.

@braveltd
Copy link

make dark theme available by default for all read the docs pleeeeeeaseee. we need it so much!

@ShalokShalom
Copy link
Author

make dark theme available by default for all read the docs pleeeeeeaseee. we need it so much!

You can use this
https://darkreader.org/

@pllim
Copy link
Contributor

pllim commented Sep 22, 2023

Now that there is a beta dashboard at https://beta.readthedocs.org/dashboard/ , is dark theme for dashboard supported yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Support question
Projects
None yet
Development

No branches or pull requests