Skip to content
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

Make changes to links and hover states based on working group feedback #1578

Closed
11 tasks done
christopherthomasdesign opened this issue Mar 23, 2021 · 7 comments
Closed
11 tasks done
Assignees
Labels

Comments

@christopherthomasdesign
Copy link
Member

christopherthomasdesign commented Mar 23, 2021

What

Make final design decisions and tweaks to links and hover states after the working group review. List of things to do below.

Why

So we can ship the changes!

Who needs to know about this

Designer, developer

Further detail

Summary of working group review

Done when

Directly related:

  • work out what to do with colour changes across all kinds of links, and make sure they're consistent
  • users whose browsers don’t support text-decoration-thickness won’t see a change on hover, other than the pointer - cursor – decide whether we're ok with that or consider having a colour change too
  • mock up multi-line links at every size to make sure the hover underlines don’t butt into the letters below
  • check how the links look in legacy mode – make sure GOV.UK can ship it!

Review components that contain links that are treated differently and decide if they need to change at all:

  • back link
  • footer
  • details
  • header
  • tabs

Broader scope but also worth doing:

@christopherthomasdesign
Copy link
Member Author

christopherthomasdesign commented Apr 8, 2021

Update on design work

Working on this draft PR: alphagov/govuk-frontend#2089
Preview: https://govuk-fronte-text-decor-7mqpfi.herokuapp.com/

I changed the hover underline thicknesses to stop them crashing into the text below at larger sizes – increasing the min width to 3px and decreasing the max to 0.12em. It’s a bit close with 16px body-s text, but if you set the minimum width too low, the hover thickness at 19px stays too thin. The aim is to make the state clearer – I think a 2px change in width is much more obviously visible, 1px is a bit too subtle.

I lean towards not applying a colour change on hover too, for the sake of consistency and simplicity. From what I remember, our previous experiments found that there wasn’t really a good way to apply a ‘universal tint’ that could apply the same darkening effect to any colour consistently. Something about not being able to darken white… If there’s no colour change, it also means you don’t have to worry about colour contrast of hover states so long as the text itself has enough contrast.

If we take that approach, 14% of users won’t see a visual change on hover other than the pointer cursor. Text-decroration-thickness is not supported by IE11, Samsung Internet (mobile), Firefox for Android (mobile), Opera Mobile (mobile), as well as older versions of the more common browsers.

Some questions in this area:

  • How does that browser support number change once you remove mobile browsers, for which hover states aren’t too relevant anyway? (Is that even a useful way to think about it)
  • Could do a polyfill for IE11 which would retain the existing colour change for those browsers? Would it be worth it?

I’ve updated the listed components to be consistent with the link styles. Someone more skilled than me should probably look in detail at how the CSS actually works for all of these.

A couple of things to note on these components:

  • The details component feels to me like the thicker underline should show when you hover any part of the element, including the chevron, not just the text. Wasn’t sure how to do this, might have to code it into the component rather than just including govuk-link-common in .govuk-details__summary-text
  • For the header I used a fixed 3px underline width for all the links cos you’ve got a load of grouped elements very close to one another and having slightly different underline widths looked unbalanced to me. I stuck to using border-bottom for the logo link and mimicked the style of the other links, bc I wasn’t sure if it was possible to use text-decoration for the whole element. I’m not wild about the menu button hover state but I’m not wild about the menu button generally, and think that might be a can of worms for another day.

@36degrees
Copy link
Contributor

I lean towards not applying a colour change on hover too, for the sake of consistency and simplicity. From what I remember, our previous experiments found that there wasn’t really a good way to apply a ‘universal tint’ that could apply the same darkening effect to any colour consistently. Something about not being able to darken white… If there’s no colour change, it also means you don’t have to worry about colour contrast of hover states so long as the text itself has enough contrast.

If we take that approach, 14% of users won’t see a visual change on hover other than the pointer cursor. Text-decroration-thickness is not supported by IE11, Samsung Internet (mobile), Firefox for Android (mobile), Opera Mobile (mobile), as well as older versions of the more common browsers.

Some questions in this area:

  • How does that browser support number change once you remove mobile browsers, for which hover states aren’t too relevant anyway? (Is that even a useful way to think about it)

Switching to 'Usage relative' on caniuse gives us a better idea of where that 14% lies:

Screenshot 2021-04-08 at 13 48 15

It's mostly Samsung Internet and older versions of Chrome, with a little IE11, and older iOS and Firefox in the mix.

  • Could do a polyfill for IE11 which would retain the existing colour change for those browsers? Would it be worth it?

I'm wondering if it’d be easier and safer to just keep the existing colour changes on hover ‘for now’ whilst we’re still aiming to support IE11 as a 'compliant' browser, and look at removing them and simplifying the hover styles later when IE11 has dropped off of our support matrix entirely, and once more users have updated to the latest versions of evergreen browsers. I don't think we'd be introducing any 'new' inconsistency? It just makes it perhaps a little more obvious.

  • The details component feels to me like the thicker underline should show when you hover any part of the element, including the chevron, not just the text. Wasn’t sure how to do this, might have to code it into the component rather than just including govuk-link-common in .govuk-details__summary-text

Yep, agreed. I think I've got this working fine, but because it's slightly 'special' I haven't yet found a way to do this without duplicating the underline styles in the component.

For the header I used a fixed 3px underline width for all the links cos you’ve got a load of grouped elements very close to one another and having slightly different underline widths looked unbalanced to me. I stuck to using border-bottom for the logo link and mimicked the style of the other links, bc I wasn’t sure if it was possible to use text-decoration for the whole element.

All sounds good. We'll need to do a little bit of work to make the underline width 'customisable' but that's OK. Is the offset the same?

I’m not wild about the menu button hover state but I’m not wild about the menu button generally, and think that might be a can of worms for another day.

I think the menu is technically a button rather than a link… but yes, this might be a can of worms we don't want to open just yet.

I think we'll also need to work out what to do with the footer as there's a bug in Chromium (affecting Chrome, Edge and Opera) when text-decoration-offset is used in a multi-column layout – see https://bugs.chromium.org/p/chromium/issues/detail?id=1190987#c7.

We might need to remove the offset for the footer only, and create an issue to undo that once the bug's been fixed and usage of the affected versions of Chrome drops off? It does mean those links look subtly different to the others, but it sort of works, I think, because they’re already different enough being black rather than blue?

@christopherthomasdesign
Copy link
Member Author

I'm wondering if it’d be easier and safer to just keep the existing colour changes on hover ‘for now’ whilst we’re still aiming to support IE11 as a 'compliant' browser, and look at removing them and simplifying the hover styles later when IE11 has dropped off of our support matrix entirely, and once more users have updated to the latest versions of evergreen browsers. I don't think we'd be introducing any 'new' inconsistency? It just makes it perhaps a little more obvious.

Yeah this seems a sensible compromise. Let's do this.

We might need to remove the offset for the footer only, and create an issue to undo that once the bug's been fixed and usage of the affected versions of Chrome drops off? It does mean those links look subtly different to the others, but it sort of works, I think, because they’re already different enough being black rather than blue?

Yep sounds good

@christopherthomasdesign
Copy link
Member Author

Have checked the links in legacy mode – the underlines all seem to work ok for me, just using the old colours.

@36degrees
Copy link
Contributor

Yeah this seems a sensible compromise. Let's do this.

Are we happy to keep the colour change for visited links as well? That was called out by the working group – although it's existing behaviour, it is possibly slightly more noticeable with the underline?

@christopherthomasdesign
Copy link
Member Author

christopherthomasdesign commented Apr 8, 2021

Just revisiting the links without underlines guidance. I think it broadly still stands. We could be stronger on it, and say you should really only remove underlines for things like navigation.

I think part of making the underlines lighter is to reduce the chance of "the number or placement of links mak(ing) them difficult to scan or interact with the element they’re part of"...

If we removed that bit it could read more like:

Links without underlines

Only remove underlines from links if it’s clear to the user from the context that they’re links, even without the underline. For example, links in a header or side navigation won’t necessarily need underlines. Users will understand that they’re links because of their position on the page and how they persist across different pages.

——

Someone who can actually write could tighten that up but hopefully you get the idea!

Would be interested to hear what you think about this @CharlotteDowns @timpaul

@christopherthomasdesign
Copy link
Member Author

Are we happy to keep the colour change for visited links as well? That was called out by the working group – although it's existing behaviour, it is possibly slightly more noticeable with the underline?

I think let's keep it – makes it consistent with our approach with the other kinds of links. Like with those, we can revisit it when browser support is better and when if we decide to stop IE11 one day.

36degrees added a commit to alphagov/govuk-frontend that referenced this issue Apr 9, 2021
We have a long-standing issue (#1417) [1] from an audit in May 2019 about the link hover state not being clear:

> The colour change when a user hovers over a link is not clear and this was especially difficult for low vision users to determine.
>
> Ensuring that the state change is distinctive would benefit low vision users in particular, while benefiting all mouse users in general.

This was raised as a usability issue rather than a WCAG failure.

We’ve been keeping an eye on browser support for the `text-decoration-thickness` property, and its introduction into Chrome 87 means that all evergreen browsers now support it. We can therefore use `text-decoration-thickess` as a way to differentiate the link on hover.

Some of the rationale for this is included in a comment around the time of the previous working group review [2]. The broad intention is that the thicker underline is a state change that can work across any combination of text colour and background colour, as long as the link has enough contrast in its default state.

We set the underline to a minimum width to 3px with a max to 0.12em. The aim is to make the state change clear whilst avoiding the underline crashing into the text below at larger sizes. A minimum 3px width ensures at least a 2px change from the default 1px thickness. It’s a bit close with 16px body-s text, but if you set the minimum width too low, the hover thickness at 19px stays too thin. [3]

We're retaining the existing colour change on hover, as without the colour change there would be no state change in browsers that don't support `text-decoration-thickness`, including IE11. We can revisit this decision as and when our browser support requirements change. [4]

[1]: #1417
[2]: #1417 (comment)
[3]: alphagov/govuk-design-system#1578 (comment)
[4]: alphagov/govuk-design-system#1578 (comment)

Co-authored-by: Chris Thomas <[email protected]>
36degrees added a commit to alphagov/govuk-frontend that referenced this issue Apr 9, 2021
We have a long-standing issue (#1417) [1] from an audit in May 2019 about the link hover state not being clear:

> The colour change when a user hovers over a link is not clear and this was especially difficult for low vision users to determine.
>
> Ensuring that the state change is distinctive would benefit low vision users in particular, while benefiting all mouse users in general.

This was raised as a usability issue rather than a WCAG failure.

We’ve been keeping an eye on browser support for the `text-decoration-thickness` property, and its introduction into Chrome 87 means that all evergreen browsers now support it. We can therefore use `text-decoration-thickess` as a way to differentiate the link on hover.

Some of the rationale for this is included in a comment around the time of the previous working group review [2]. The broad intention is that the thicker underline is a state change that can work across any combination of text colour and background colour, as long as the link has enough contrast in its default state.

We set the underline to a minimum width to 3px with a max to 0.12em. The aim is to make the state change clear whilst avoiding the underline crashing into the text below at larger sizes. A minimum 3px width ensures at least a 2px change from the default 1px thickness. It’s a bit close with 16px body-s text, but if you set the minimum width too low, the hover thickness at 19px stays too thin. [3]

We're retaining the existing colour change on hover, as without the colour change there would be no state change in browsers that don't support `text-decoration-thickness`, including IE11. We can revisit this decision as and when our browser support requirements change. [4]

[1]: #1417
[2]: #1417 (comment)
[3]: alphagov/govuk-design-system#1578 (comment)
[4]: alphagov/govuk-design-system#1578 (comment)

Co-authored-by: Chris Thomas <[email protected]>
Co-authored-by: Charlotte Downs <[email protected]>
36degrees added a commit to alphagov/govuk-frontend that referenced this issue Apr 30, 2021
We have a long-standing issue (#1417) [1] from an audit in May 2019 about the link hover state not being clear:

> The colour change when a user hovers over a link is not clear and this was especially difficult for low vision users to determine.
>
> Ensuring that the state change is distinctive would benefit low vision users in particular, while benefiting all mouse users in general.

This was raised as a usability issue rather than a WCAG failure.

We’ve been keeping an eye on browser support for the `text-decoration-thickness` property, and its introduction into Chrome 87 means that all evergreen browsers now support it. We can therefore use `text-decoration-thickess` as a way to differentiate the link on hover.

Some of the rationale for this is included in a comment around the time of the previous working group review [2]. The broad intention is that the thicker underline is a state change that can work across any combination of text colour and background colour, as long as the link has enough contrast in its default state.

We set the underline to a minimum width to 3px with a max to 0.12em. The aim is to make the state change clear whilst avoiding the underline crashing into the text below at larger sizes. A minimum 3px width ensures at least a 2px change from the default 1px thickness. It’s a bit close with 16px body-s text, but if you set the minimum width too low, the hover thickness at 19px stays too thin. [3]

We're retaining the existing colour change on hover, as without the colour change there would be no state change in browsers that don't support `text-decoration-thickness`, including IE11. We can revisit this decision as and when our browser support requirements change. [4]

[1]: #1417
[2]: #1417 (comment)
[3]: alphagov/govuk-design-system#1578 (comment)
[4]: alphagov/govuk-design-system#1578 (comment)

Co-authored-by: Chris Thomas <[email protected]>
Co-authored-by: Charlotte Downs <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

3 participants