Markdown comments break visited link styling
Categories
(bugzilla.mozilla.org :: General, defect)
Tracking
()
People
(Reporter: bzbarsky, Unassigned)
References
Details
Bugzilla has this bit in global.css:
a {
color: #039;
}
a:visited {
color: #636;
}
but links inside markdown comments, including links generated by "bug NNNN" references, have this style applied in global.css:
.markdown-body a {
color: #0366d6;
text-decoration: none;
}
and no corresponding :visited style. Ignoring for the moment the difference in the basic link colors between the two cases, it means that if you look at something like https://bugzilla.mozilla.org/show_bug.cgi?id=1449992 the "Depends on: 1489308" right before bug 1449992 comment 4 is colored purple but the link in bug 1449992 comment 4 itself is not, even though they are the exact same URL.
I do somewhat wonder why the markdown-body case needs to override the global link colors at all...
Comment 1•6 years ago
|
||
We have intentionally removed the :visited
style from the Markdown preview in Bug 1518268 because of reports like Bug 1519225. I know it’s inconsistent with other parts, but we’ll completely remove the global :visited
style soon once a new style guide comes up in Bug 1377977.
![]() |
Reporter | |
Comment 2•6 years ago
|
||
That's ... unfortunate. I actually rely on the visited styles to tell whether I still need to investigate things, etc...
Comment 3•6 years ago
•
|
||
My thoughts on :visited
… It’s not all about styling but the fragility.
-
It’s basically broken since CSS was invented. For example, the following links are all the same page but considered as different links. The problem is not CSS but HTML which offers no way to canonicalize links. We need the
canonical
attribute on the<a>
element, just like<link rel="canonical">
. While canonical URLs have been mostly used for SEO, browsers should respect them for the history and bookmark management. -
The style will be easily reset once the browser’s history is cleared.
-
The style could be inconsistent among multiple browsers and devices unless the user’s browsing history is completely synced.
Given that, we need a server-side solution to reliably mark visited/read bugs like an email client or feed reader. Bugzilla is already logging the user’s last visited timestamp on bugs, so we could use the data. The problem is, we are logging only on bugs that the user is getting involved as the Assignee, CC, etc. Once all the visited bugs are logged as I’m proposing in Bug 1481106, we could solve the issue.
![]() |
Reporter | |
Comment 4•6 years ago
|
||
I understand that you don't like :visited, yes. I'm just saying that I actually do like it and use it...
I guess I can always add some user stylesheet overrides for the broken styling.
Comment 5•6 years ago
|
||
There are three factors for there being no :visited color:
- The previous visited color was quite close to black (especially for some eyes and some displays) and we've been receiving complaints about it since 2015.
- We adopted https://github.com/sindresorhus/github-markdown-css for the markdown CSS to provide a more familiar feel for the new markdown comments (and, make sure common elements work well together).
- It's difficult to find a good color that doesn't look bad.
The current link color (that GitHub chose) meets these requirements:
- 4.5:1 contrast between the non-link text color and the background.
- 4.5:1 contrast between the link text color and the background.
- 3:1 contrast between the link text color and the surrounding non-link text color.
So if we can find a color that also meets those requirements and is also has enough contrast from the default link color,
then we could use that.
Comment 6•6 years ago
|
||
(In reply to Kohei Yoshino [:kohei] (Bugzilla UX) (FxSiteCompat) from comment #1)
We have intentionally removed the
:visited
style from the Markdown preview
That's a sad news… :-( While I am not a big fan of :visited styles in general it's an important feature for certain websites likes search engines or bug trackers like Bugzilla. Bugzilla is a productivity tool and it should be all about efficiency for the users of the tool, that's much more important for a bugtracker than a color which looks good. With this change I no longer see which tickets I have already visited and I have to invest more time…
Comment 7•6 years ago
|
||
(In reply to Dylan Hardison [:dylan] (he/him) from comment #5)
There are three factors for there being no :visited color:
- The previous visited color was quite close to black (especially for some eyes and some displays) and we've been receiving complaints about it since 2015.
- We adopted https://github.com/sindresorhus/github-markdown-css for the markdown CSS to provide a more familiar feel for the new markdown comments (and, make sure common elements work well together).
- It's difficult to find a good color that doesn't look bad.
The current link color (that GitHub chose) meets these requirements:
- 4.5:1 contrast between the non-link text color and the background.
- 4.5:1 contrast between the link text color and the background.
- 3:1 contrast between the link text color and the surrounding non-link text color.
So if we can find a color that also meets those requirements and is also has enough contrast from the default link color,
then we could use that.
Here is a proposal, Dylan, that doesn't change the color, but other properties.
- a non-visited link gets
font-weight: bold
. - a visited link gets
font-weight: normal
.
This checks all the accessibility requirements + the requirement that visited links can be told apart from non-visited links for people with vision impairment.
This has the added benefit of having non-visited links stand out in comments (current color makes them more difficult to see, even if it obeys accessibility reqiurements).
Comment 8•6 years ago
|
||
(In reply to Julien Wajsberg [:julienw] from comment #7)
Here is a proposal, Dylan, that doesn't change the color, but other properties.
- a non-visited link gets
font-weight: bold
.- a visited link gets
font-weight: normal
.
That’s a good idea. Email clients like Thunderbird, Gmail, etc. usually behave like that. Actually my BzDeck app did it.
Comment 9•6 years ago
|
||
But I really want people to know that relying on CSS :visited
is a bad idea in general. We’ll soon prove it ourselves by making the bug URL shorter, from https://bugzilla.mozilla.org/show_bug.cgi?id=1531517 to https://bugzilla.mozilla.org/bug/1531517 then your history will be reset!
Comment 10•6 years ago
|
||
That would be pretty bad. But places.sqlite is just a database, you can edit the history in there if you care.
Comment 11•6 years ago
•
|
||
We’ll soon prove it ourselves by making the bug URL shorter, from https://bugzilla.mozilla.org/show_bug.cgi?id=1531517 to https://bugzilla.mozilla.org/bug/1531517 then your history will be reset!
This doesn't prove anything at all. If you change the URL format then the history will be reset, yes. But that's an one-time event and after the change we will have the new URLs in our history once we visits the bugzilla tickets again. So while that's annoying, it's acceptable. But it's not acceptable to regress the usability of a productivity tool in the long term.
Comment 12•6 years ago
|
||
As I said in Bug 1552922 I’ll add :visited
to the new skin until a better solution like Bug 1472450 will be implemented. Thanks for your input!
Description
•