python / python-docs-theme

Sphinx theme for Python documentation
Other
74 stars 58 forks source link

Make option to invert/modify colors for documentation pages #145

Closed brandonardenwalli closed 10 months ago

brandonardenwalli commented 1 year ago

Feature or enhancement

When reading the docs page in dark mode with night shift, some variables are invisible to see. For example in https://docs.python.org/3/c-api/intro.html#types, int, long, double and char* are impossible to read without highlighting the text. This looks to affect any other parts of docs with same coloring too, for example all texts typedef on https://docs.python.org/3/c-api/typeobj.html page are practically invisible.

Environment:

Enable dark mode for system/browser (black background), AND enable night shift. I think there are multiple ways to do so, for example Windows has built in night shift mode to enable screen to be more orange (basically make screen have less blue light). For easiest reproduction, download f.lux and set color to 1900K (or as low as possible). Look at page again, and all the dark blue text, for example the type and typedef texts, became invisible.

Pitch

The docs will be much more readable and improve accessibility for bigger audience if the text colors can be modified. I'm not sure how much work this would require, but can be happy to provide feedback. Alternatively, if making the docs text configurable by end user is too much work, just hard code a more friendly color that is readable with dark mode and night shift enabled.

Let me know if you want more information!

hugovk commented 1 year ago

(I've transferred this from https://github.com/python/cpython to https://github.com/python/python-docs-theme)

Thanks for the report!

This is a contrast bug, already fixed in https://github.com/python/python-docs-theme/pull/133 and released in https://github.com/python/python-docs-theme/releases/tag/2023.7, but we had to skip that release due to https://github.com/python/python-docs-theme/issues/144/ / https://github.com/python/python-docs-theme/pull/141.

Let's revert https://github.com/python/python-docs-theme/pull/141 so we can make a new release.

brandonardenwalli commented 1 year ago

Thanks!

Also how to transfer issue? Sorry I made in cpython, I read through https://docs.python.org/3/bugs.html#using-the-python-issue-tracker and it said to make issue at https://github.com/python/cpython/issues. How do I know when to file there versus here?

hugovk commented 1 year ago

Here's how to transfer, you need write permissions for the repo: https://docs.github.com/en/issues/tracking-your-work-with-issues/transferring-an-issue-to-another-repository

Yep, it's not obvious the issue is for code in this repo (most styling comes from this theme, but some come from the base Sphinx theme as well), and you did the right thing, thanks again :)

brandonardenwalli commented 1 year ago

Ok, great to know this https://docs.github.com/en/issues/tracking-your-work-with-issues/transferring-an-issue-to-another-repository!

Thanks for reply!

hugovk commented 10 months ago

This has now been released and deployed, and the contrast is now improved. Thanks!