-
Notifications
You must be signed in to change notification settings - Fork 86
Link styling tweaks #1413
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
base: master
Are you sure you want to change the base?
Link styling tweaks #1413
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think adding the dotted underlines with JavaScript is a good move. It adds overhead on every page load, linear in the number of links (which is most of the content), and the resulting separation is still pretty easy to miss IMO. The more scalable solution would be to try and phrase things in such a way that you don't get runs of links (like the original |transitive| |well-founded relation|
got reworded into |relation| that is |transitive| and |well-founded|
).
theme/css/general.css
Outdated
.content dt > a[href^='https']::after, | ||
.content dd > a[href^='http']::after, | ||
.content dd > a[href^='https']::after { | ||
content: '⇱'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All external link icons point to the upper right. Since there's no unicode symbol for this icon specifically, I think it'd be better to use an inline SVG, as explained e.g. here: https://christianoliff.com/blog/styling-external-links-with-an-icon-in-css/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theme/css/general.css
Outdated
text-decoration: none; | ||
} | ||
/* External link indicator */ | ||
.content p > a[href^='http']::after, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are all those selectors trying to exclude? From my testing only the on-page TOC uses absolute links, so you could do .content a[href^="https://"]
and remove the icon in nav.pagetoc a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did I implement your suggestion correctly?
I have to disagree that it's not an improvement, but let's not fight about this now. The issue is very minor anyways, and I've reverted the relevant changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, this one slipped through the cracks
theme/css/general.css
Outdated
background-repeat: no-repeat; | ||
background-size: contain; | ||
display: inline-block; | ||
color: var(--fg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't actually affect the color of the symbol, which is always black, even on dark backgrounds, rendering it invisible.
What should work is replacing all the background-*
properties with mask-*
properties, and setting the color with background-color: var(--fg);
. This works at least for me on Firefox, but Safari browsers might need duplicating all those properties with --webkit-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really out of my depth here, but I've implemented your suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try to take a closer look later this week
Summary
Add dotted underlines under links that are adjacent making it possible to tell them apart, e.g.:


The styling does not apply to code, or concept paragraph symbols, and it only applies to links with another link directly adjacent to it.
vs old: