- From: Jonathan Neal <jonathantneal@hotmail.com>
- Date: Mon, 15 Jun 2015 11:15:46 -0400
- To: www-style@w3.org
- Message-ID: <BLU437-SMTP9290CCE96668E5E634272A4B80@phx.gbl>
When I was testing a website for keyboard accessibility, I noticed that most of its failures were due to hover styles not being applied to elements "hovered over" using the tab key. The solution was to add :focus selectors to :hover rules. This got me thinking about a problem many designers and developers run into with :hover. > The :hover pseudo-class applies while the user designates an element with a pointing device... - CSS4 specification (http://dev.w3.org/csswg/selectors/#hover-pseudo) Limiting the :hover pseudo-class to pointing devices was a real missed opportunity for keyboard accessibility. The naming of :hover is somewhat misleading, as it specifically means elements "designated" with a pointing device, rather than any form of input. I propose we add a common pseudo-class for :hover and :focus. A good name could be :enter, as it is harmonious with PointerEvents, and it shares an intrinsic association with keyboards. > The :enter pseudo-class applies while the user designates an element with a keyboard, pointing device, or other form of input. To test and perhaps implement this pseudo-class in the wild, I’ve created a polyfill / prollyfill. https://github.com/jonathantneal/postcss-pseudo-class-enter <https://github.com/jonathantneal/postcss-pseudo-class-enter> Best, Jonathan
Received on Monday, 15 June 2015 15:16:18 UTC