Skip to content
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

Code snippets in dark theme are unreadable #115349

Closed
raiyankamal opened this issue Feb 9, 2024 · 6 comments · Fixed by python/python-docs-theme#177
Closed

Code snippets in dark theme are unreadable #115349

raiyankamal opened this issue Feb 9, 2024 · 6 comments · Fixed by python/python-docs-theme#177
Labels
3.8 (EOL) end of life 3.9 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error

Comments

@raiyankamal
Copy link

raiyankamal commented Feb 9, 2024

Documentation

When python docs are viewed in dark theme, code snippets are put against a light colour background. This makes white letters unreadable. Please see attached screenshot.

Screenshot 2024-02-09 at 4 38 35 PM

This screenshot was taken at: https://docs.python.org/3.8/library/csv.html

Steps to reproduce:

  1. Visit https://docs.python.org/3.8/library/csv.html
  2. Select theme "Dark" from the drop down menu in the top right corner.
  3. Scroll to see any code snippet.

Linked PRs

@AlexWaygood AlexWaygood transferred this issue from python/cpython Feb 9, 2024
@terryjreedy
Copy link
Member

This only affect the 3.8 and 3.9 docs and for those I confirm the white on white problem with Firefox on Windows. 3.7 and before have no dark theme. For 3.10 and after the dark theme snippet have a dark background that is just slightly lighter than the regular dark background. If possible, the 3.10 dark theme should be backported. Whether this should affect the 3.8 and 3.9 releases is up to the release manager. @ned-deily ?

@ned-deily
Copy link
Member

The release manager would be @ambv.

@hugovk
Copy link
Member

hugovk commented Feb 9, 2024

I susect the problem is that 3.8 has an old pinned Sphinx version 2.4.4, but the theme is unpinned and the newest:

https://github.com/python/cpython/blob/3.8/Doc/requirements.txt

It is trying to apply dark mode but failing. IIRC the theme requires Sphinx 3 or newer.

The minimal fix is probably to pin the theme to an older version that still works with Sphinx 2 (and no dark theme).

Otherwise, we should upgrade Sphinx, and maybe some other dependencies and our own custom extensions. And it would be a good idea to pin the theme too.


And to prevent this kind of thing in the future, let's consider pinning the docs deps for branches as they leave the bugfix phase and enter security only.

@hugovk hugovk transferred this issue from python/python-docs-theme Feb 12, 2024
@hugovk
Copy link
Member

hugovk commented Feb 12, 2024

The minimal fix is probably to pin the theme to an older version that still works with Sphinx 2 (and no dark theme).

I've transferred this back to the CPython repo to use the issue number for this.

@hugovk hugovk added docs Documentation in the Doc dir 3.9 only security fixes 3.8 (EOL) end of life type-bug An unexpected behavior, bug, or error labels Feb 12, 2024
ambv pushed a commit that referenced this issue Feb 13, 2024
ambv pushed a commit to ambv/cpython that referenced this issue Feb 13, 2024
…-115351)

Pin theme to fix code snippets
(cherry picked from commit 3fcea41)

Co-authored-by: Hugo van Kemenade <[email protected]>
ambv added a commit that referenced this issue Feb 13, 2024
(cherry picked from commit 3fcea41)

Co-authored-by: Hugo van Kemenade <[email protected]>
@hugovk
Copy link
Member

hugovk commented Feb 13, 2024

PRs merged, let's close this.

The 3.8 and 3.9 docs will be deployed during their next releases, which as luck would have it, should be this week.

@terryjreedy
Copy link
Member

3.8.19 and 3.9.19 were released March 19, 2024. However, accessing the 3.8 and 3.9 docs displays doc for 3.8.18 and 3.9.18, not the new releases, and the problems remain. #118199 is the new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.8 (EOL) end of life 3.9 only security fixes docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants