1
0
mirror of https://github.com/golang/go synced 2024-09-30 18:18:32 -06:00

godoc: better distinguish links and link state

There were two issues with links in godoc:

1) They were only distinguished from ordinary text only by color,
affecting those with color-vision deficiencies.

2) The same blue used for links is used by non-links,
affecting everybody.

This change adds a an underline to all links.

Usually, it is safe to skip underlining in locations where it clear
that the only contents are navigational links, such as #pkg-index.
However, (2) prevented this.

To work around this I used some less well supported CSS techniques:
http://caniuse.com/#feat=text-decoration

Less capable browsers, which are unlikely to be used by developers, may
have a less than optimal experience, unfortunately. In more capable
browsers, including those without full support, the experience is quite
pleasant and the additional underlying does not interfere with the godoc
aesthetic.

For golang/go#22171

Change-Id: I5a0d817793e8aa31912ba065b4e5a63d4a3f138c
Reviewed-on: https://go-review.googlesource.com/69150
Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
jimmyfrasche 2017-10-07 12:42:05 -07:00 committed by Andrew Bonventre
parent 5d186094d5
commit 9bd2f44268
2 changed files with 10 additions and 12 deletions

View File

@ -2925,16 +2925,15 @@ body {
a,
.exampleHeading .text {
color: #375EAB;
text-decoration: none;
}
a:hover,
a,
.exampleHeading .text:hover {
text-decoration: underline;
-webkit-text-decoration: skip;
text-decoration-skip: ink;
}
.article a {
text-decoration: underline;
}
.article .title a {
a:hover,
.exampleHeading .text {
text-decoration: none;
}

View File

@ -48,16 +48,15 @@ body {
a,
.exampleHeading .text {
color: #375EAB;
text-decoration: none;
}
a:hover,
a,
.exampleHeading .text:hover {
text-decoration: underline;
-webkit-text-decoration: skip;
text-decoration-skip: ink;
}
.article a {
text-decoration: underline;
}
.article .title a {
a:hover,
.exampleHeading .text {
text-decoration: none;
}