Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Mark external links with an icon #2123

Open
vdavid opened this issue Feb 2, 2022 · 0 comments
Open

Mark external links with an icon #2123

vdavid opened this issue Feb 2, 2022 · 0 comments
Assignees
Labels
🏗 Handbook website Any issues and asks related to the handbook website, not the content of the handbook.

Comments

@vdavid
Copy link
Contributor

vdavid commented Feb 2, 2022

Context

Internal and external links look the same now.

Internal vs external

Proposal

I'd find it helpful if external links were marked with an icon like on Wikipedia and some other sites.
It looks like a matter of a CSS tweak, and I'm happy to contribute.

More info

Two solution ideas from @felixfbecker:

a[href^="https://"]::after {
  content: '↗';
}

This would be just a simple arrow but nice in that it will automatically adapt the color. Might actually work well in our minimal design. (font size, margin etc can be tweaked)
Or alternatively like Wikipedia with an SVG as a background image, placed on the right side using some padding:

a[href^="https://"] {
  background-image: url(external-link-icon.svg);
  background-position: center right;
  background-repeat: no-repeat;
  padding-right: 1em;
}

(note that in this case the color of the SVG must be hardcoded to our link color and not adapt dynamically to the :visited / :hover / :active link color)

@jeanduplessis: "Feel free to implement and reach out to #content-platform team if you need help."

@quinnkeast: "We do this in the Sourcegraph product itself. I think it’s a good pattern to adopt!"

image

@vdavid vdavid added the 🏗 Handbook website Any issues and asks related to the handbook website, not the content of the handbook. label Feb 2, 2022
@vdavid vdavid self-assigned this Feb 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🏗 Handbook website Any issues and asks related to the handbook website, not the content of the handbook.
Projects
None yet
Development

No branches or pull requests

1 participant