:hover and :focus
We are familiar with the :hover
pseudo-class, which targets elements with a pointer entered into them. The MDN docs refer to this state as “when the user designates an element with a pointing device”.
I think limiting :hover
to pointing devices was a missed opportunity, partially realized by the adoption of touch screens, and fully realized by attention now directed at keyboard accessibility. This limitation particularly affects keyboards, which must be separately targeted using the :focus
pseudo-class.
I suggest a new pseudo-class be introduced that will target all designations of an element, by any means; whether it be done by a mouse or a finger or a keyboard or any other device that can enter into an element.
:enter
I suggest the name be :enter
. It is harmonious with PointerEvents, and it shares an intrinsic association with keyboards.