-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review the text decoration offset for links #2743
Comments
Changes to links in Chrome 104: Screen.Recording.2022-08-03.at.09.46.29.mov |
Just tagging @christopherthomasdesign on this issue as it might be a good time to look at this again BackgroundWe think Chrome v104 (August 2022) lifted link underlines 1px higher than before, but we only confirmed this when our Percy visual regression tests upgraded from Chrome v98 to Chrome v108 Decimal placesWe've nearly finished our switch from Node Sass (deprecated) to Dart Sass (latest) to generate CSS. This means we're now seeing In a good way, we're now seeing the same styles as other service teams that already switched to Dart Sass But strangely this has affected link underlines too (GIF showing before/after): ☝️ Note: With 10 decimal places we strangely lose the underline breaks for descenders |
Have done some exploration into this now. I asked the GDS design community to give feedback on a couple of options. It's worth noting that I've gone on the assumption that it's best for the underline offset to be set at a whole number of pixels away (rather than half pixels). I think this should result in more consistent rendering across different devices – let me know if this is wrong. The consensus was that for 19px body copy, an equivalent of a 3px underline offset looks better than 2px. This is because the underline interferes less with the overall shape of the text, which should be better for readability. It does means that on Chrome the descenders can slightly bump into the line because it doesn't do ink skipping at that distance: But we decided the benefits to readability (from the line being further away) outweighed that. When I was playing around with this in Frontend, I changed the value to I'm not sure if we want to apply this value to links at all sizes in the scale. I had a look at it in the frontend review app in different browsers, and thought it looked fine at all the sizes. I think we currently just have one value that calculates the offset for all type sizes, rather than setting a different one for each size in the scale. I'm fine with the value being optimised for body text, as most links will appear at that size. But interested to hear what others think. |
What
Revisit the default value for the text decoration offset on links, set by
$govuk-link-underline-offset
:govuk-frontend/src/govuk/settings/_links.scss
Lines 39 to 46 in c9d331c
Why
As noted in #2183 (comment), when we introduced the new link styles we had to make a compromise on the offset of the underlines, as Chromium-based browsers measured the offset differently to other browsers, putting the underline further away.
This issue appears to have been fixed as of Chrome 104 (https://bugs.chromium.org/p/chromium/issues/detail?id=1251634). Once Chrome 104 reaches widespread adoption, we can revisit the value now that the behaviour in different browsers is consistent.
Who needs to work on this
Designer
Who needs to review this
Designer and developer?
Done when
$govuk-link-underline-offset
) and made any changesThe text was updated successfully, but these errors were encountered: