GeezerVison is showing github.com — Add colour to version change directives by hugovk · Pull Request #185 · python/python-docs-theme
Conversation
hugovk
commented
Mar 29, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Similar to the sidebars in PEP 7 and PEP 8, we can add coloured sidebars and text to the version change directives.
Dark theme
Light theme
Accessibility check
- We're not relying on the colour in the sidebar or text to convey meaning. The words remains as before.
- The text like "Changed in version x.y" is now in colour. The contrast ratio meets at least the WCAG AA guidelines (4.5), with all but one meeting AAA (7.0).
- In dark mode, the same colour is used for the sidebar and the text:
- Green: 7.13 (AAA)
- Yellow: 12.07 (AAA)
- Red: 4.53 (AA)
- In light mode, the sidebar colour is the same as in dark mode. The text needs to be darker to be readable:
- Green: 7.08 (AAA)
- Orange: 7.11 (AAA)
- Red: 7.09 (AAA)
versionremoved
I also pre-emptively applied the red styling for the versionremoved directive, which will be released in the next Sphinx 7.3.0 (sphinx-doc/sphinx#11905).
Comparison with other themes
This is similar to how the Awesome theme does it.
These themes also add a background colour:
And Nefertiti for Sphinx adds a coloured box around it.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
erlend-aasland reacted with rocket emoji
hugovk
changed the title
Add coloured sidebars to versionadded/changed/deprecated
Add colour to version change directives
Mar 29, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hugovk. I would love to see us move away from red and green. Since the wording is here too, I'm less concerned. When we work with an accessibility designer, we should come up with best practice light/dark themes for accessiblity.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
erlend-aasland, hugovk, and pradyunsg reacted with thumbs up emoji
Reviewers
willingc
willingc approved these changes
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
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.