Skip to content

CSS: code-blocks are not displayed in monospace #581

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

Closed
westurner opened this issue Apr 9, 2020 · 5 comments
Closed

CSS: code-blocks are not displayed in monospace #581

westurner opened this issue Apr 9, 2020 · 5 comments

Comments

@westurner
Copy link

The code blocks in the Python Devguide are not in monospace? It's borking the ASCII art, and possibly other code blocks?

Example::

  • RTD w/ Devguide Sphinx theme:

https://devguide.python.org/garbage_collector/#memory-layout-and-object-structure

  • GH rst2html:

https://github.com/python/devguide/blob/master/garbage_collector.rst#memory-layout-and-object-structure

  • GH raw:

https://raw.githubusercontent.com/python/devguide/master/garbage_collector.rst

@westurner
Copy link
Author

RTD theme:

  • Chrome Android: not monospace
  • FF Android: monospace

GH rst2html:

  • *: monospace

@hugovk
Copy link
Member

hugovk commented Sep 28, 2020

Can reproduce:

  • Chrome macOS: monospace
  • Chrome Android: not monospace

image

It gets the font from pydoctheme.css and looks like it's falling back to sans-serif:

tt, code, pre {
    font-family: monospace, sans-serif;
    font-size: 96.5%;
}

However, monospace works on this test page:

image

https://www.zipcon.net/~swhite/docs/computers/browsers/fonttest.html

Could it be the non-whole number font-size: 96.5%;?

@hugovk
Copy link
Member

hugovk commented Sep 28, 2020

And this also happens at https://pip.pypa.io, so this is likely a https://github.com/python/python-docs-theme bug.

@alexprengere
Copy link

For the record, all the code-blocks from the devguide appears in monospace on my Chrome Android, as of August 2021. Should this be closed?

@westurner
Copy link
Author

Looks good

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

No branches or pull requests

3 participants