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 Comment

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