Skip to content

Create accessible external links#457

Open
joemull wants to merge 1 commit intomainfrom
b-306-accessible-external-links
Open

Create accessible external links#457
joemull wants to merge 1 commit intomainfrom
b-306-accessible-external-links

Conversation

@joemull
Copy link
Member

@joemull joemull commented Feb 2, 2026

Fixes #306.

This strategy uses a JS script on all pages to apply the proper attributes and icon.

Why JS is needed

I wonder whether it would be cleaner to do this just in the CSS without needing any JS, with a target for any links which have other domains?
a[href^="http"]:after

It's not possible to meet all the user requirements with CSS only, since we need to add the blank target attribute to user-generated content like news items, and we also want to check that urls do not include the current domain (there are sometimes hard-coded links to the openlibhums website that include the domain).

Screenshots

Screenshot from 2026-02-02 15-46-40 Screenshot from 2026-02-02 15-46-29 Screenshot from 2026-02-02 15-46-22

Copy link
Member

@StephDriver StephDriver left a comment

Choose a reason for hiding this comment

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

  • I like the svg solution - especially compared with the use of fonts on Janeway.

  • I think the spacing isn't quite right everywhere:

Image Image
  • I would like you to consider the readability impact of these icons. When adding similar to the Janeway front of house the text was cluttered, so I made them smaller, recede and in superscript so that they don't clutter the text as much. I'm not saying exactly the same is needed here, I offer this as a starting point for considering ways to keep the text readable.
opacity = 70%
vertical-align: super
font-size: 0.7em
Image

versus

Image

@StephDriver StephDriver assigned joemull and unassigned StephDriver Feb 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create accessible external links

2 participants