Use consistent line-height for light & dark theme#227
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on the copy button, I noticed the line height of the
preelement differs for the light and dark theme. It is set to120%for the light theme125%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.csstakes precedence:Whereas for the dark theme, it is

pygments_dark.csswhich 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/