querkmachine / beeps.website

My personal interweb site where I really just put whatever I want.
https://beeps.website
MIT License
4 stars 0 forks source link

Add visited link style #61

Closed querkmachine closed 5 months ago

querkmachine commented 5 months ago

@xkeeper0 recently posted on Cohost about history being an accessibility feature. They're right, and it does quite bug me when text-heavy sites don't style visited links.

My website doesn't have a visited link style to it, and it probably ought to.

Ponderings

Changing text colour

Finding a visited link colour might be a bit difficult within the site's purposefully spartan palette. Ideally any new colours introduced would be complementary to the existing ones and conceptually linked to the standard link colour (e.g. purple links become pink; green links become teal)

Visited link colours would need to have minimum 4.5:1 contrast ratio with the background and 3:1 contrast ratio with the standard link colour to meet WCAG level AA. This probably rules out just using slightly lighter or darker shades of the base colours.

Changing underline ('highlight') colour

Currently, the link hover state doesn't change the text colour at all, instead manipulating the underline colour. A visited style could be applied that changes the underline colour on visited links.

This would be a less drastic change, but the need to have a 3:1 minimum contrast ratio with the standard underline colour would (to my knowledge) still apply, so finding a suitable colour might still be difficult without wandering outside of the established palette.

Other ponders

There might be alternative options to doing this that don't involve introducing a new colour, such as alternative underline styles.

There are (probably) many places that we don't want the visited link colour to appear, like the header and footer(?)

querkmachine commented 5 months ago

Annoyingly, link underlines are currently styled using a single colour that has its alpha channel modified to indicate the hover state.

I was hoping to extend this to include a new alpha value for the visited state, but alpha channels on visited states are ignored as part of the privacy-focused locked-down-ness of visited link styles, as described on MDN.