| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| } | ||
|
|
||
| pre { | ||
| line-height: 125%; |
There was a problem hiding this comment.
To keep the initial value for the theme, rather than the overridden one:
| line-height: 125%; | |
| line-height: 120%; |
Sorry, something went wrong.
There was a problem hiding this comment.
I have to check later if this will work or if we need a more specific selector since pygments_dark.css is included last and sets 125%
Sorry, something went wrong.
There was a problem hiding this comment.
It was indeed the case. I went for div.body pre to increase the specificity and override pygments_dark.css
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
While working on the copy button, I noticed the line height of the pre element differs for the light and dark theme. It is set to 120% for the light theme 125% for the dark theme, which is not a huge difference but it's better to be consistent.
The reason for the discrepancy is the order in which the css is included in the <head>. For the light theme, classic.css takes precedence:

Whereas for the dark theme, it is pygments_dark.css which is the last stylesheet in the <head>:

This seems to be related to how sphinx inserts the css for pygments:
https://github.com/sphinx-doc/sphinx/blob/a6d7ae16739bf92a032a7c4df0297db7cf120ec9/sphinx/builders/html/__init__.py#L258-L262
In any case, we can fix this by simply setting the line height in pydoctheme.css.
📚 Documentation preview 📚: https://python-docs-theme-previews--227.org.readthedocs.build/