Created
January 5, 2022 11:02
-
-
Save elfacht/040c656af564a05f94ca19de5e40d097 to your computer and use it in GitHub Desktop.
:focus-visible
This file contains 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
/* @source https://css-tricks.com/the-focus-visible-trick/ */ | |
/* Focusing the button with a keyboard will show a dashed black line. */ | |
button:focus-visible { | |
outline: 4px dashed black; | |
} | |
/* Focusing the button with a mouse, touch, or stylus will show a subtle drop shadow. */ | |
button:focus:not(:focus-visible) { | |
outline: none; | |
box-shadow: 1px 1px 5px rgba(1, 1, 0, .7); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment