-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc: #13771: Make html links inside paragraphs more readable #13807
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
Conversation
Can you underline only on hover? |
Sure! Updated and rebased |
@adrientetar Uh, then we would have only the color to distinguish links and it is bad for accessibility. I think we need underlines at least in the docblock area. |
@lifthrasiir what about bolding links like the previous docs did? If so, should another color be used or would that be enough? |
@lifthrasiir Do you have something concrete backing this? MSDN shows that color-recognition deficiencies still let the people see blue. I don't see any concrete evidence of cases where someone would a/ not see the blue color and b/ not have any software alternative available that would not require a mandatory edit to the mainline stylesheet – otherwise they would not be able to browse most modern websites (GitHub here included) (?). Bootstrap does not underline links and has a committance towards accessibility, the accessibility plugin itself does not add mandatory underline either... Underlining is being phased out is modern websites because it halts the document flow, much more than a color change does. |
@adrientetar Right, using the color and nothing else itself is not a problem. It is a problem that using the color which doesn't have enough contrast from the surrounding text. (And there are certainly people who cannot distinguish hues at all.) My initial comment is based on the fact that @ipetkov's screenshot doesn't seem to have enough contrast when grayscaled. Some concrete numbers: WCAG 2.0 Level AA requires at least 3:1 contrast for most visual cues (it's actually 4.5:1 except for large texts, but for the purpose of this discussion let's think it as an absolute minimum). The PR uses Well, this seems to suggest that one can meet the basic accessibility by simply making the link color slightly lighter. What do you think about this? Note: We should also eventually think about other visual cues for the accessibility. |
Yup no problem about making it lighter. |
Bootstrap's @lifthrasiir and @adrientetar do you think this is acceptable? |
It's fine by me. |
Yeah, it looks definitely better. |
Should links be underlined on hover? The old doc style did not do this, but GitHub for example does show underlines on hover. |
Standalone documentation does it but it's mostly a leftover from Bootstrap. Do not have a strong bias with this. |
All links inside docblocks will have their color set to `#4e8bca` (a light blue color to contrast against the black text). This color also offers a visible contrast from the surrounding text if viewed as grayscale, making it suitable for accessability. Docblock links will also be underlined when hovered over.
Updated once more |
All links inside docblocks will have their color set to `#4e8bca` (a light blue color to contrast against the black text). This color also offers a visible contrast from the surrounding text if viewed as grayscale, making it suitable for accessability. Docblock links will also be underlined when hovered over. Before:  After (links underlined only on hover, cursor not shown in image):  Fix #13771
Two selector fixes for rustdoc: - links colored in blue (#13807) was also affecting headers, which are anchored to their respective ids - the header unstyling from #13776 was being applied to all headers also Additionally, remove a stray title in the documentation. This makes the crate title of prelude appear as header instead of an inline paragraph of text (all others work normally and do not have that header tag). The design is unchanged from my previous template (e.g. [here](http://adrientetar.legtux.org/cached/rust-docs/struct.CChars.htm)), however it is now properly applied. The last fix remaining is to enable webfonts service from `static.rust-lang.org`, this is #13593. r? @alexcrichton, @brson
All links inside docblocks will have their color set to
#4e8bca
(a light blue color to contrast against the black text). This color also offers a visible contrast from the surrounding text if viewed as grayscale, making it suitable for accessability.Docblock links will also be underlined when hovered over.
Before:

After (links underlined only on hover, cursor not shown in image):

Fix #13771