The :focus-within pseudo-class applies to elements for which the :focus pseudo class applies. An element also matches :focus-within if one of its descendants in the flat tree (including non-element nodes, such as text nodes) matches the conditions for matching :focus.
Status in Chromium
Enabled by default (tracking bug) in:
- Chrome for desktop release 60
Consensus & Standardization
Search tagscss-selectors, selectors-4, focus-within,
Last updated on 2020-11-19