Skip to content

Conversation

fredrik-bakke
Copy link
Collaborator

@fredrik-bakke fredrik-bakke commented Apr 25, 2025

Summary

  • Add dotted underlines under links that are adjacent making it possible to tell them apart, e.g.:
    image
    image
    The styling does not apply to code, or concept paragraph symbols, and it only applies to links with another link directly adjacent to it.
  • Don't display underline on hover in code. New:
    image
    vs old:
    image
  • Add external link indicator, e.g., the symbol after the first link below image

@fredrik-bakke fredrik-bakke added enhancement New feature or request website labels Apr 25, 2025
Copy link
Collaborator

@VojtechStep VojtechStep left a 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|).

.content dt > a[href^='https']::after,
.content dd > a[href^='http']::after,
.content dd > a[href^='https']::after {
content: '⇱';
Copy link
Collaborator

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/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the link! Here's the new styling following your cited guide

image

text-decoration: none;
}
/* External link indicator */
.content p > a[href^='http']::after,
Copy link
Collaborator

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

Copy link
Collaborator Author

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?

@fredrik-bakke
Copy link
Collaborator Author

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|).

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.

Copy link
Collaborator

@VojtechStep VojtechStep left a 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

background-repeat: no-repeat;
background-size: contain;
display: inline-block;
color: var(--fg);
Copy link
Collaborator

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-

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out the exclusion selector for the navigation pane does not work on firefox

image

Copy link
Collaborator Author

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

Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants