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

Update focus style on Error Summary and Notification Banner #3870

Closed
wants to merge 1 commit into from

Conversation

querkmachine
Copy link
Member

@querkmachine querkmachine commented Jun 28, 2023

Applies the same govuk-focused-box mixin used for images in #3819 to the Error Summary and Notification Banner components, as per @davidc-gds's suggestion.

Merging this would be one way to resolve #1936, as it fixes the problem of the yellow outline not providing sufficient contrast.

Screenshots

Error Summary

image

Notification Banner

image

Thoughts

There was some questions as to whether we should use the exact same focus style as #3819, or develop ones specific to these components that replicate way that text input focus works—with the coloured border becoming thicker and only having the yellow focus colour outline it, as current.

In my mind, using the same (yellow and black) outline is the 'safer' option. As I found when digging into #3925, the Notification Banner component is currently tied to the $govuk-brand-colour setting and there is no requirement or guarantee that the colour used provides sufficient contrast with white. In that case, the black outline would be necessary for WCAG compliance. (However, the more ideal solution would probably be to divorce the colour of the Notification Banner from the brand colour.)

@querkmachine querkmachine self-assigned this Jun 28, 2023
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3870 June 28, 2023 15:53 Inactive
@querkmachine querkmachine requested a review from a team June 28, 2023 16:14
Base automatically changed from image-link-focus-styles to main July 14, 2023 11:45
@querkmachine querkmachine marked this pull request as ready for review July 14, 2023 15:28
Copy link

@dav-idc dav-idc left a comment

Choose a reason for hiding this comment

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

Just as I was good with the pull request for the govuk-focused-box focus addition for linked images, I'm also good with this one.

I'l agree it's a bit 'loud' with the 3 layered colours. But also, when these success / error messages come up, they are deserving of attention. So, I can personally justify the value in them being louder than normal.

Additionally, they aren't generally tab-able items -- they only receive focus when focus is intentionally applied by the service, and not by the user. So in regular navigation scenarios using the tab key, this focus won't come up.

I know that alternate focus stylings were being investigated though, including one that @christopherthomasdesign was suggesting. It might be worth double-checking if we're all ok with this 'noisy' focus.

Referencing the banner focus issue in #3870, it could even be that the consistent approach there would be to add weight to the borders on banners when focused. I mean it'd need some tweaking, but something like:

Screenshot 2023-06-28 at 17 19 41 I think especially on the banners, having 3 layers of variously contrasting lines creating a striped effect is more visually noisy than you need it to be. Especially for the error summary, which creates a slightly alarming combination of red, yellow and black stripes. Error summary is focussed by default when you land on a page so that state will be what most people see when they get an error.

And to add to the discussion, here's the option where the yellow and black orderings are reversed:
error summary message with a focus indicator. The focus is an inner 4 pixel black outline, with another 4 pixel yellow outline outside of that one.

As I said at the top of this comment though, I'm leaning towards the version currently in this PR. Partially because the current version will have very strong contrast and pass the upcoming AAA 'Focus appearance' WCAG 2.2 criterion, regardless of the colour used for the border around the error summary, notification banner, or even success panel elements. It basically is an incredibly visible and successful focus state regardless of the content inside it.

The other options presented can become muddled if the inner content's border colour is too light (for the 2-colour proposal) or too dark (for the black-inner-outline proposal).

But yes, I also acknowledge this focus is basically an ideally functional focus, and doesn't take into account aesthetics much.

@querkmachine
Copy link
Member Author

Of note, this is one of the few existing focus styles we have that meets the WCAG 2.2 Focus Appearance criterion. 😉 #3839 (comment)

@querkmachine
Copy link
Member Author

Closing this off as we're now doing a deeper exploration into the use and appropriateness of our focus styles. alphagov/govuk-design-system#3007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

Consider changing or removing focus state for error summary and notification banner
3 participants