Created
June 29, 2023 10:09
-
-
Save steroyle/d6137f11a752349b91012700b41c7e64 to your computer and use it in GitHub Desktop.
Multi outline focus state using box-shadow
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
// Using two contrasting box-shadow colours means it doesn't matter what background colour the element is over. | |
&:focus { | |
outline: transparent; | |
box-shadow: 0 0 0 2px black, /* inner colour here */ | |
0 0 0 4px white; /* outer colour here */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment