department-of-veterans-affairs / vets-design-system-documentation

Repository for design.va.gov website
https://design.va.gov
40 stars 61 forks source link

Focus styles: Select color for focus style and identify other focus methods, if necessary #1314

Open davidakennedy opened 1 year ago

davidakennedy commented 1 year ago

Context

The VA.gov Design System needs updated focus styles for better accessibility because the current styles don't meet color contrast guidelines in the Web Content Accessibility Guidelines. In updating the styles, we want to also think ahead to future versions of WCAG, which likely have more stringent requirements for focus styles.

Specifically, the current focus style fails to meet compliance in the scenario of white button on dark background (e.g. the active search button).

Links:

Work to be done

This work is to:

Feedback needed:

Acceptance criteria

davidakennedy commented 1 year ago

This work isn't complete, but I've started thinking through some possible color options and wanted to share and explain the thinking here. The color explorations can be seen in the audit recommendations and notes doc I created. Some thoughts on why I went the direction I did in starting with those colors:

A few other thoughts on where I'm at with this work:

humancompanion-usds commented 1 year ago

@davidakennedy - While working on the Back-to-Top change from button to link I came across the Scottish Design System's focus state (Laura, I think, also pointed me to it in another issue; great minds and all that). Instead of using a border ring for focus on buttons and links it flips the colors and adds a bottom inset drop shadow as a border. Worth a look I think: https://designsystem.gov.scot/styles/states/

danbrady commented 7 months ago

Hi @davidakennedy - We're working on porting the VADS table component to v3. I noticed when a table is sorted, the USWDS gives a blue color background to the actively sorted column:

image

When the same scenario happens in VADS, the focus ring - which is currently yellow - wouldn't meet contrast guidance:

image

I see you're working through this issue, so I wanted to bring it to your attention. Or if you have any thoughts, let us know. Thanks!

davidakennedy commented 7 months ago

@danbrady Thanks for the report! I'm not actively working on this, but definitely encourage you all to drop gotchas in this ticket so the team has it when work begins again.

davidakennedy commented 2 months ago

I've started to work on this between other team work. A few notes: