robinmetral / website

Source code of robinmetral.com, built with brut
https://robinmetral.com
2 stars 0 forks source link

When to remove the WebKit workaround for insufficient link contrast in dark mode? #55

Open robinmetral opened 3 months ago

robinmetral commented 3 months ago

Links in the default browser dark mode color (using color-scheme) have insufficient contrast on WebKit browsers. This is a known issue.

I worked around it using hardcoded colors for links:

https://github.com/robinmetral/website/blob/ef779cee5bd77712e3be99bfe3b1050890f215ff/templates/page.html#L144-L153

The bug was fixed on 11.09.2023 (PR) and I attempted to remove the workaround (bc544b0310fea1a86095d383bf5aeb455c169468).

However, testing on a real Safari browser (courtesy of TestGrid), it seems that the issue had not been fixed. (The easiest way to reproduce is to use this Glitch reproduction, since it's a hassle to change the preferred color scheme on remote devices.)

Issue reproduced on Safari 17.2, anchors have insufficient contrast

The device was an iPhone 15 Pro with iOS 17.2.1, using iOS Safari 17.2 (WebKit 617.1.17, according to the MDN mapping).

Questions: in which WebKit/Safari version has the WebKit fix been released? When can we assume that most Safari browsers (90%+) include the fix?

bc544b0310fea1a86095d383bf5aeb455c169468 was reverted for now.


Edit: according to the data below, this will likely take another year.

robinmetral commented 3 months ago

The fix was released in stable Safari 17.4, under WebKit 618.1.15.

robinmetral commented 3 months ago

A rough estimate.

We can extrapolate usage data for specific Safari versions using CanIUse data[^1] for features that shipped in the target versions.

Safari version Release date CanIUse feature % of total users below version % of Safari users below version
17.4 5 March 2024 Promise.withResolvers 10.33[^2] 58.46[^3]
17.2 11 December 2023 unprefixed HTMLMediaElement.preservesPitch attribute 6.65 37.63
16.5 18 May 2023 CSS :user-valid selector 4.22 23.88

\<25% total Safari usage and <5% total usage seems like an acceptable support policy for this website. We hit it when going back to Safari <16.5.

Since 16.5 was released about a year ago, it'll likely take another year until Safari <17.4 meets the policy.

Conclusion: I'm keeping the workaround around until at least May 2025.

[^1]: Current CanIUse estimates are based on the April release of StatCounter GlobalStats [^2]: desktop version global usage + iOS version global usage [^3]: version global usage * 100 / global Safari usage (17.67%)