Recent chats
ASKGEEZ Q&A GUIDETechnology & devices

How can I make keyboard focus visible on controls with different backgrounds?

Quick answer

Test every keyboard-focusable component in its unfocused and focused states, including hover, selected, and unselected appearances, on each relevant background. Record where the indicator blends in or is difficult to distinguish. A two-color indicator is one possible approach for varied backgrounds, but judge the implemented result in context. WCAG 2.2’s Focus Appearance criterion is Level AAA, not the AA minimum.

LET’S WORK THROUGH IT

The question, the details, the next step.

Question

How can I review whether focus is visible across controls that use different backgrounds?

Geez

Treat it as a component-by-component review, rather than checking one button on one page and assuming the same treatment works everywhere. First list the controls people can reach with a keyboard—for example, buttons, links, fields, tabs, and menu items. Then identify the backgrounds and visual states each control can appear on.

For each combination, compare the control without focus to the same control with focus. Check normal, hover, selected, and unselected appearances where they apply. Include different surrounding backgrounds, such as a light panel, a dark panel, or an image-backed area. Note whether the focus indicator is easy to notice and whether it blends into either the control or what surrounds it.

WCAG 2.2’s Focus Appearance criterion addresses indicator size and the contrast change between focused and unfocused states; it is a Level AAA criterion, not the AA minimum. Its guidance also says to review components in selected and unselected states. [S1]

Follow-up question

What should I record in the test matrix so the review finds cases where a single style fails?

Geez

Give each row one component, one state, and one background context. Record the indicator style being reviewed, then note what you can actually see: for instance, whether its outline is clear around the whole control or disappears along one edge. Use a separate row for a different selected state or background rather than combining several conditions into a vague note.

A useful result is specific and actionable: “Tab, selected, dark sidebar: indicator’s dark segment blends into the sidebar.” That points to the difficult boundary without claiming that the whole design has passed or failed a formal conformance assessment. If one color disappears against some backgrounds, flag those combinations for design review; don’t let a good result on a light background stand in for the rest.

Follow-up question

Could one focus indicator work on both light and dark areas?

Geez

Possibly, but check the implemented indicator against every relevant component and surrounding color. A two-color indicator is one approach described in W3C Technique C40: contrasting portions can help retain visibility where one portion blends into a background. It can help reveal why a single-color treatment is hard to see across varied backgrounds or component states. [S2]

That technique is informative guidance, not the only design option or a guarantee of conformance. WCAG’s focus guidance distinguishes the change between focused and unfocused appearances from contrast against adjacent colors, which is addressed separately by Non-text Contrast. [S1] So record both what changes when focus appears and whether the indicator remains discernible against nearby colors. Assess your actual implementation in context.

Follow-up question

Can you give me a reusable matrix and a practical way to fill it out?

Geez

Use this copyable row template; add rows until every relevant combination is represented:

Component: [control] | State: [normal/hover/selected/unselected] | Background/context: [surface or image area] | Indicator tested: [style or color] | Observation: [clear, blends at edge, hard to notice] | Follow-up: [review/change/retest]

Worked example, with invented placeholder details: “Component: Tab | State: selected | Background: [dark sidebar] | Indicator: [single light outline] | Observation: [outline hard to distinguish on selected fill] | Follow-up: [compare an alternative treatment, then retest].” Repeat for the tab when unselected and for any other background it can appear on. Keep observations tied to the exact combination you reviewed. After a design change, repeat the affected rows, including the focused and unfocused comparison; don’t mark unreviewed combinations as clear.

A practical checklist

  • List keyboard-focusable components and the backgrounds on which each appears.

  • Create separate rows for normal, hover, selected, and unselected states where applicable.

  • Compare each control’s focused appearance with its unfocused appearance.

  • Record exactly where an indicator blends in or becomes difficult to notice.

  • Retest affected combinations after a design change; treat a two-color indicator as an option, not a guarantee.

A few more useful answers

Is the WCAG 2.2 Focus Appearance criterion an AA requirement?

No. The cited Focus Appearance criterion is Level AAA. Do not describe it as the AA minimum. [S1]

Does using a two-color indicator guarantee conformance?

No. W3C Technique C40 describes one informative approach, not a standalone guarantee. Assess the implemented indicator in context. [S2]

Should I review a selected control as well as an unselected one?

Yes. Include both when the component has those states, because its focus appearance should be reviewed across selected and unselected appearances. [S1]

Sources

References used for this guide.

  1. [S1] Understanding WCAG 2.2: Focus Appearance
    w3.org · Checked
  2. [S2] W3C Technique C40: Two-color focus indicator
    w3.org · Checked

YOUR QUESTION. YOUR DETAILS.

Let’s work through your situation.

Get a tailored answer or help with your next task. Starts at $1, with a quote before you pay.

Ask your own question
← Back to Geez at Work