Skip to content

Instantly share code, notes, and snippets.

@meduzen
Created August 24, 2017 18:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meduzen/68af420431d8fca1e4523ccc8a2ba70d to your computer and use it in GitHub Desktop.
Save meduzen/68af420431d8fca1e4523ccc8a2ba70d to your computer and use it in GitHub Desktop.
/* Answer to https://twitter.com/stevepiron/status/900732215415508994
*
* How can I not show the :focus style when clicking an element, but keep it for keyboard navigation?
*/
// hover (mouse only)
:hover {}
// click (mouse only)
:active:hover {}
// focus (keyboard only)
:focus:not(:hover) {}
// click… or let’s say “Enter key” (keyboard only)
:active:not(:hover) {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment