---
title: "The Focus-Indicated Pseudo-class :focus-visible"
description: "The :focus-visible pseudo-class lets authors style focus indicators only when the browser's own heuristics would draw one, such as during keyboard navigation or in text inputs, but not on a mouse click on a generic element."
url: "https://swe.quest/articles/the-focus-indicated-pseudo-class-focus-visible-82771fd0458dfee1"
canonical: "https://webkit.org/blog/12179/the-focus-indicated-pseudo-class-focus-visible/"
source: "WebKit"
published: "2022-01-31"
difficulty: "medium"
kind: "Announcement"
reading_minutes: 4
tags: ["css","accessibility","browsers"]
---

# The Focus-Indicated Pseudo-class :focus-visible

A post on [WebKit](https://swe.quest/sources/webkit.md), published 2022-01-31, 4 min read, Announcement. Original: [https://webkit.org/blog/12179/the-focus-indicated-pseudo-class-focus-visible/](https://webkit.org/blog/12179/the-focus-indicated-pseudo-class-focus-visible/)

## Summary

The :focus-visible pseudo-class lets authors style focus indicators only when the browser's own heuristics would draw one, such as during keyboard navigation or in text inputs, but not on a mouse click on a generic element. That fixes the common accessibility failure where :focus was used to remove outlines entirely. WebKit shipped it in Safari Technology Preview 138 alongside expanded Web Platform Tests, which aligned heuristics across engines; for example, clicking a div with tabindex=0 no longer shows an indicator. User agent stylesheets now use :focus-visible, so workarounds like :focus:not(:focus-visible) are no longer needed.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [Accessibility](https://swe.quest/tags/accessibility.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)

## Prerequisites

- CSS selectors ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

:focus-visible, WebKit, Safari Technology Preview, Web Platform Tests, Igalia Open Prioritization

## Related posts

- [Non-interactive Elements with the inert attribute](https://swe.quest/articles/non-interactive-elements-with-the-inert-attribute-966ae3b60cf7bc71.md): WebKit · 2022-04-26 · Medium · 3 min read · Browsers, Accessibility, Frontend, CSS
  The HTML inert attribute disables focus, clicks, text selection and editing on an element and its descendants, and hides them from assistive technologies like aria-hidden="true".
- [WebKit Features for Safari 27.2](https://swe.quest/articles/webkit-features-for-safari-27-2-f545f4ccec69d87b.md): WebKit · 2026-10-26 · Medium · 5 min read · Browsers, CSS, Frontend, Accessibility
  Safari 27.2 refines Customizable Select with a new \`::field-content\` pseudo-element for styling the displayed selected option without \`\<selectedcontent\>\`, adjusts \`appearance: base-select\` UA styles (flex-based button spacing, inherited \`text-overflow\`, simpler \`::picker-icon\`), and uses \`safe\` alignment so large pickers stay within the viewport.
- [Using :has() as a CSS Parent Selector and much more](https://swe.quest/articles/using-has-as-a-css-parent-selector-and-much-more-a6801a96d8b4f383.md): WebKit · 2022-08-18 · Medium · 13 min read · CSS, Frontend, Browsers
  The CSS \`:has()\` pseudo-class, long requested as a "parent selector", lets developers style an element based on its descendants, its following siblings, or the state of elements anywhere in the DOM.
- [The golden rule of Customizable Select](https://swe.quest/articles/the-golden-rule-of-customizable-select-f338a360afa66726.md): WebKit · 2026-06-15 · Medium · 3 min read · Accessibility, CSS, Browsers, Frontend
  Customizable select, arriving in Safari 27, lets developers fully style \`\<select\>\` elements with custom arrows, icons and swatches while keeping native keyboard navigation and accessibility semantics.
- [Accessibility considerations behind code search and code view](https://swe.quest/articles/accessibility-considerations-behind-code-search-and-code-view-4501ed426b29574e.md): GitHub Engineering · 2023-07-06 · Medium · 10 min read · Accessibility, Frontend, Browsers, Design systems
  GitHub rebuilt code search and code view to remove accessibility barriers that pushed screen reader users toward raw files.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
