For the past few weeks Alice Boxhall and I have been discussing/working out details of a proposal, creating a prollyfill for it and testing it (I’m using this on some projects) and putting together a post which was published this morning explaining the need for exposing a concept that we call “input modality”.. The proposal itself proposes that this be exposed through a Media Query like
@media (modality: keyboard) { :focus { outline: 2px solid blue; } }
The best way to understand the need and use is probably the article linked above which will walk you into the other two, but effectively we show that the browser itself is privy to information that about how the user is currently using the interface and has been using this for years in various ways that are shut off from authors creating a kind of accessibility footgun for things like the focus ring as authors try to use standards that are currently provided. In my own testing I’ve received overwhelmingly positive responses from users as our focus rings all of the sudden make sense and work appropriately for everyone based on how they are actually using the interface, not capabilities of their browser or machine or globally being present at inappropriate seeming times.
The concept of modality is essentially this: If the user starts interacting with the keyboard, that is their current context - combined with what they are interacting with we can determine the appropriate modality - if the user starts using a mouse, that might change. Some users, like me, switch modalities all the time.