sphinx-rtd-dark-mode
Dark mode for the Sphinx Read the Docs theme.
What it is and what it does
This is a Sphinx extension that layers dark mode functionality onto the Read the Docs theme. When installed and added to your Sphinx conf.py, it injects a toggle button in the bottom right corner of your documentation site, letting readers switch between light and dark color schemes. The reader's choice is saved in their browser's local storage, so their preference persists across visits.
The extension is lightweight—it has only one runtime dependency, sphinx-rtd-theme—and requires minimal configuration. You can set a default mode (dark or light) for first-time visitors, but after that, the user's stored preference takes over. The package is marked Production/Stable and has been dormant since late 2023, suggesting it is feature-complete rather than actively developed.
Use it for:
- Enable dark mode for technical documentation sites to reduce eye strain for readers working at night or in low-light environments.
- Provide accessibility-conscious documentation by offering both light and dark viewing modes without requiring server-side theme switching.
- Add a polished UX touch to Sphinx-based project documentation with minimal setup overhead.
- Let readers with visual sensitivity or preference for dark interfaces control their viewing experience without site configuration changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds a toggleable dark mode interface to Sphinx documentation built with the Read the Docs theme, letting readers switch between light and dark viewing modes with a button in the corner.
Yes, if you use Sphinx with the Read the Docs theme and want to offer dark mode to your readers. Installation is straightforward, maintenance burden is minimal, and the permissive MIT license poses no legal risk. The dormant status is not a concern for a feature-complete extension; however, verify compatibility with your current sphinx-rtd-theme version before deploying to production.
Install
sphinx-rtd-dark-mode on PyPI
pip
pip install sphinx-rtd-dark-modeuv
uv add sphinx-rtd-dark-modepoetry
poetry add sphinx-rtd-dark-modeInstalling sphinx-rtd-dark-mode
Before you install
Low friction install with a single runtime dependency on sphinx-rtd-theme. Maintenance is dormant—last release was 2023-09-19 and no commits since 2023-09-22—but the package is marked Production/Stable and has received no security reports.
License in practice
MIT license is permissive; you can use this in commercial or private projects without restriction, though you must retain the license notice.
Quickstart
pip install sphinx-rtd-dark-mode
# In conf.py:
extensions = ["sphinx_rtd_dark_mode"]
default_dark_mode = True # optional: users start in dark mode
Requires Python 3.4 or higher and the sphinx-rtd-theme package to be installed and active in your Sphinx configuration.
Verify before relying
- Whether the dark mode toggle works correctly with recent versions of sphinx-rtd-theme, given the last commit was 2023-09-22.
- Whether browser local storage persistence of user preference works across all modern browsers.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.4) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — sphinx-rtd-theme |
| Maintenance | dormant — 1,060 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 262,700/month — #8,368 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sphinx_rtd_dark_mode-1.3.0-py3-none-any.whl
Tags
More Sphinx packages
Parses Python docstrings in ReST, Google,…
permissive · top 1,000 on PyPI
SphinxSphinx generates professional documentation…
permissive · top 1,000 on PyPI
sphinxcontrib-serializinghtmlA Sphinx extension that outputs documentation…
permissive · top 1,000 on PyPI
alabasterAlabaster is a clean, responsive Sphinx theme…
permissive · top 1,000 on PyPI
sphinxcontrib-htmlhelpA Sphinx extension that generates HTML help…
permissive · top 1,000 on PyPI
sphinxcontrib-qthelpA Sphinx extension that converts documentation…
permissive · top 1,000 on PyPI
shibuyaShibuya is a Sphinx documentation theme that…
permissive · top 15,000 on PyPI
sphinx-bootstrap-themeA Sphinx theme that applies Bootstrap CSS and…
permissive · top 15,000 on PyPI
sphinx-rtd-themeA Sphinx theme that renders documentation with…
permissive · top 5,000 on PyPI
darkdetectDetects whether the operating system is in Dark…
permissive · top 5,000 on PyPI
sphinx-book-themeA Sphinx theme that renders documentation as an…
permissive · top 5,000 on PyPI
sphinx-togglepromptAdds a button to Python code blocks in Sphinx…
permissive · top 15,000 on PyPI
Pallets-Sphinx-ThemesProvides Sphinx themes styled for Pallets…
permissive · top 15,000 on PyPI
furoFuro is a clean, responsive Sphinx theme for…
permissive · top 5,000 on PyPI
sphinx-press-themeA modern, responsive Sphinx documentation theme…
permissive · top 15,000 on PyPI
sphinx-autobuildWatches Sphinx documentation source files for…
permissive · top 5,000 on PyPI