# Focus Appearance

> The Focus Appearance WCAG success criterion sets minimum requirements for the size and contrast of the focus indicator.

## How visible must a focus indicator be under WCAG?

The level AAA success criterion that requires the focus indicator to be at least as large as a 2px thick outline around the element and to have a contrast ratio of at least 3:1 between focused and unfocused states.

- Topic: WCAG 2.2
- Type: concept

## Example

Wrong:

```css
button:focus {
  outline: none;
}
```

Right:

```css
button:focus-visible {
  outline: 2px solid #1a56db;
  outline-offset: 2px;
}
```

Removing the outline leaves keyboard users lost; a solid 2px `:focus-visible` outline with strong contrast meets the size rule.

## Common mistakes

- Using only a subtle color change of the background as the focus indicator.

## Key points

- Focus styles are not removed with `outline: none` without a visible replacement.
- The focus outline is at least `2px` thick and has at least 3:1 contrast with the unfocused state.
- Focus styles use `:focus-visible` and are visible on both light and dark backgrounds.

## Interview questions

### What contrast does a focus indicator need?

Focus Appearance asks for at least 3:1 contrast between the same pixels in the focused and unfocused states.

### Is `outline: none` ever allowed?

Only when another clearly visible focus style replaces it. Focus Visible at level AA requires a visible indicator for keyboard focus.

### Should I style `:focus` or `:focus-visible`?

Use `:focus-visible` so browsers show the ring for keyboard focus and skip it for mouse clicks on buttons.

## Related cards

- [:focus-visible](https://wonderium.dev/css/focus-visible.md)
- [outline](https://wonderium.dev/css/outline.md)
- [outline-offset](https://wonderium.dev/css/outline-offset.md)
- [Focus Not Obscured](https://wonderium.dev/a11y/focus-not-obscured.md)
- [WCAG 2.2](https://wonderium.dev/a11y/wcag-2-2.md)

---

- Level: [Accessibility](https://wonderium.dev/a11y.md)
- HTML version: https://wonderium.dev/a11y/focus-appearance
- Last updated: 2026-11-25
