Re: [csswg-drafts] [css-pseudo] Please change the behavior of :focus-within (#5654)

The overlapping nature of the pseudos is intentional - in many cases you *do* want to apply your focus styles whether the element itself or a descendant is what has focus, so the eye is drawn to the element in either case.

Cases like yours were considered relatively rarer, and they're still solveable with the current design:

<table>
 <thead>
  <tr><td>Select parent when...<th>Parent has focus<th>Parent doesn't have focus
 </thead>
 <tr><th>Child has focus<td><code>:focus-within</code><td><code>:focus-within:not(:focus)</code>
 <tr><th>Child doesn't have focus<td><code>:focus</code><td><code>:not(:focus-within)</code>
</table>

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5654#issuecomment-715472010 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 23 October 2020 17:22:53 UTC