Created
May 22, 2019 22:31
-
-
Save rosemarydotworld/338b1069b21c922e2e989dec571e4894 to your computer and use it in GitHub Desktop.
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
const focusVisible = (props, styles) => ` | |
${props.theme.inputModality === 'KEYBOARD' && ` | |
&:focus { ${styles} } | |
`} | |
&:focus-visible { | |
${styles} | |
} | |
` |
Wow, great questions.
Would it make sense to add a default?
Sure, if there's a focus style we agree is a good choice for a lot of elements. I reckon this problem belongs in the capable hands of y'all designers.
Also, should it cancel out the default :focus styles when inputModality is not KEYBOARD? Or should that be left to the component itself?
Yes, if we're not already canceling out focus styles in our normalization styles.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it make sense to add a default? So using it in a styled component could look like
in addition to
Also, should it cancel out the default
:focus
styles wheninputModality
is notKEYBOARD
? Or should that be left to the component itself?For example …