question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with all content: Missing link underlines

See original GitHub issue

MDN URL: https://developer.mozilla.org/en-US/docs/ (and all pages below)

Issue

None of the links within the content have an underline. They are difficult to distinguish from the surrounding content and require interaction to identify them in some cases.

The page content is dark gray (#212121) and the link color is dark blue (#00458b). with a contrast ratio of 1.7:1, it is fair to assume most users with good vision under ideal conditions will have to take a second look.

As it stands now, the content links would fail WCAG 2.1 Success Criterion 1.4.1 Use of Color. The non-normative G182 recommends using an additional visual cue besides color. G183 recommends a 3:1 contrast ratio and an additional visual cue on focus or hover, but is now mooted with the advent of touch interfaces. I go into more detail about alternatives to underlines in On Link Underlines.

Recommended fix

To restore underlines to links in the content…

In the file: /node_modules/@mdn/minimalist/sass/atoms/_typography.scss

At line 69, please strike text-decoration: none;. Reference code with - preceding the line to strike:

  /* text links */
  a:link,
  a:visited {
    color: $link-color;
-    text-decoration: none;

    &:hover,
    &:focus,
    &:active {
      text-decoration: underline;
    }
  }

In the file: /node_modules/@mdn/minimalist/sass/atoms/_links.scss

At line 3, please strike text-decoration: none;. Reference code with - preceding the line to strike:

  a {
    color: $link-color;
-    text-decoration: none;

    &:hover,
    &:focus {
      text-decoration: underline;
    }

This will restore underlines to links in the navigation and elsewhere as well. If you want to remove those, I suggest more targeted removal of underlines scoped to just those areas to ensure underlines are retained on links outside the content.

If you would like to try the content with restored underlines without fiddling in the browser’s dev tools, I have bookmarklet that will restore underlines (which I tested on MDN) at http://rosel.li/bookmarklets#underlines.

Specific section or headline?

Throughout.

What did you expect to see?

Underlines on links.

Did you test this? If so, how?

I tried to use the content.

MDN Content page report details

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:50 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
dhananjayd1729commented, Mar 2, 2021

@schalkneethling I was having exams back then so I couldn’t look into it. But yeah from today onwards I will try to run again.

1reaction
dhananjayd1729commented, Feb 16, 2021

Thanks, @schalkneethling. Yes, I’m planning to work on this issue and would like to work on more issues in the future.

Read more comments on GitHub >

github_iconTop Results From Across the Web

link underline missing - WordPress.org
My links in pages created with Neve theme using Elementor do not have underlines. The first set on the page referenced are all...
Read more >
Hyperlinks not showing in blue or underlined
It doesn't show the field codes, and when I hover over it i see the link but I need to have it in...
Read more >
Hyperlinks in blog are not showing underlined
Hyperlink styles are defined in you stylesheet (CSS). Applying the underline text-decoration property like so: text-decoration: underline;.
Read more >
Suddenly ... underlined links? - Oxygen XML Forum
Hi, This is the default link styling and the links were styled the same way in the version 21 as well. Then pass...
Read more >
some links don't have underline decoration - Bugzilla@Mozilla
It seems that every font size in the body works except for 8pt. As well, the <code class="attribute"> tags do not affect this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found