Re: 2.4.7 Focus Visible

On 13/07/2023 20:53, Michael Livesey wrote:
> Perhaps I didn't phrase correctly.
> 
> Applying an outline around the actual checkbox is awful UX, who does that?
> 
> In order to apply good UX we need to use the onfocus event. This event 
> cannot return user agent heuristics for focus-visibility setting.

<label><input type="checkbox"> ...</label>

label:has(input:focus-visible) { /* style me */ }

(support for :has() is still behind a feature flag in Firefox at the moment)

https://codepen.io/patrickhlauke/pen/qBQxXvy

P
-- 
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
https://mastodon.social/@patrick_h_lauke | skype: patrick_h_lauke

Received on Thursday, 13 July 2023 21:29:43 UTC