Skip to content

Instantly share code, notes, and snippets.

@Lego2012
Created October 1, 2018 07:26
Show Gist options
  • Save Lego2012/aec204e71073601d8d8eff99f6e258cd to your computer and use it in GitHub Desktop.
Save Lego2012/aec204e71073601d8d8eff99f6e258cd to your computer and use it in GitHub Desktop.
CSS: Get rid of focus outline

I’m gonna start blanket adding the following rule to all my stylesheets:

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

Gets 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment