-
Notifications
You must be signed in to change notification settings - Fork 790
Line numbers are misaligned on several Sphinx themes #1579
Copy link
Copy link
Closed
Milestone
Description
A change in Sphinx (sphinx-doc/sphinx#7482) combined with a change in Pygments (#1477) has led to a wrong alignment of line numbers.
This happens with Pygments 2.7+ and Sphinx 3.1+.
See sphinx-doc/sphinx#8254 for details including screenshots.
So far, I've found these Sphinx themes to be affected:
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/default-alabaster/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/default-classic/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/default-haiku/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/default-nature/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/default-pyramid/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/default-sphinxdoc/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/astropy-sphinx-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/flask-sphinx-themes/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/groundwork-sphinx-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/insipid-sphinx-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/jupyter-sphinx-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/karma-sphinx-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/logilab-sphinx-themes/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/mozilla-sphinx-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/python-docs-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/renku-sphinx-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/solar-theme/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/sphinx-celery/
- https://sphinx-themes.github.io/sphinx-themes.org/sample-sites/sphinx-documatt-theme/
I'm not sure whether this should be fixed in Sphinx or in Pygments (or both?), but I found out that disabling this chunk of CSS (which comes from Pygments) seems to fix the problem for most themes (I didn't try all, though):
td.linenos pre {
color: #000000;
background-color: #f0f0f0;
padding: 0 5px 0 5px;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels