Pseudo-class :hover styles should also be enabled with the class selector .hover
Created by: jamesrom
It's not uncommon to have to enable the hover state of an element, even if the element isn't actually being hovered. For example, highlighting multiple related table rows, showing a link/button that will be pressed when a user performs an action, or the need to activate hover states if you have custom mouse/keyboard input.
Adding .hover
to any selectors that implement :hover
will allow elements to manually activated with js.
The current workaround involves copying the style and manually implementing .hover
.
It would be a nice, relatively simple feature that will resolve this common anti-pattern.
Note: Psuedo-classes :active
and :focus
have .active
and .focus
respectively already for buttons. So you can style a button as being active or focused even if they aren't, so I believe it makes sense to style a button as being hovered too.