Hide the annoying outline for mouse users but preserves it for keyboard users

CSS that get’s rid of the annoying outline for mouse users but preserves it for keyboard users, and is ignored by browsers that don’t support :focus-visible.

:focus:not(:focus-visible) { outline: none }

Source @LeaVerou

Leave a Reply

Your email address will not be published. Required fields are marked *