Created
March 10, 2021 05:51
-
-
Save hrdtbs/10356ff95d829809936dd0a961330651 to your computer and use it in GitHub Desktop.
hover effectをmobile(ホバーすることができる入力メカニズムがある端末)でのみactiveに置き換えるCSS
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
@media (any-hover: hover) { | |
&:hover { | |
background-color: red; | |
} | |
} | |
@media not all and (any-hover: hover) { | |
&:active { | |
background-color: red; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ref: https://developer.mozilla.org/ja/docs/Web/CSS/@media/any-hover