Underline links for readability and a11y#160
Conversation
|
Yes, using this on the active maintenance branches is good. Note we're in the https://github.com/python/python-docs-theme repo, not https://github.com/python/cpython. We'll release this theme to PyPI, and then it'll be used by the backport branches the next time they rebuild:
|
|
Good point, let's consider narrowing/lowering the underline, and see how GitHub and MDN do it. |
|
Updated to make the underline thinner, move it down a bit, and also increase the line height so it better fits in the gap. "Line height (line spacing) to at least 1.5 times the font size" is also one of the WCAG 2.1 guidelines, and improves accessibility through readability. https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html Here's how the earlier snippets with underscores look:
And from What's New in 3.13:
And from What's New in 3.12:
How does this look? |
|
This is definitely better and solves the potential confusion with underscores. I'm now -0 (from -1) on this since I still prefer the version without underlines, but if others prefer the underlines I'm fine with the change. |
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
|
Hi there @hugovk. Is there Discourse discussion for this? I believe there should be a discussion first. I would like to hear people's opinions. |







Currently this theme changes the colour of hyperlinks but doesn't underline them.
For example: https://docs.python.org/3/whatsnew/3.12.html
When hovering over a link, it changes colour and a link is shown (see "f-strings" here):
However, links should always be underlined. This improves accessibility and also readability.
For example:
Not using underlines also fails a WCAG check:
And GitHub have just enabled underlines:
Demo
https://python-docs-theme-previews--160.org.readthedocs.build/en/160/whatsnew/3.12.html