Created
July 8, 2018 12:54
-
-
Save norbert-codes/6e2716c5bd3c268cf38f683a39cc24e0 to your computer and use it in GitHub Desktop.
Removing that ugly :focus ring (and keeping it too) from: https://hackernoon.com/removing-that-ugly-focus-ring-and-keeping-it-too-6c8727fefcd2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body:not(.user-is-tabbing) { | |
| button:focus, | |
| input:focus, | |
| select:focus, | |
| textarea:focus { | |
| outline: none; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function handleFirstTab(e) { | |
| if (e.keyCode === 9) { | |
| document.body.classList.add('user-is-tabbing'); | |
| window.removeEventListener('keydown', handleFirstTab); | |
| } | |
| } | |
| window.addEventListener('keydown', handleFirstTab); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment