Last active
December 16, 2015 20:59
-
-
Save davidpett/5496434 to your computer and use it in GitHub Desktop.
hide hover states on touch devices.
leverages modernizr's html classes and SCSS magical &
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
@mixin over { | |
html.no-touch & { | |
&:hover, | |
&:focus { | |
@content; | |
} | |
} | |
html.touch & { | |
&:active { | |
@content; | |
} | |
-webkit-tap-highlight-color: rgba(#000, 0); | |
} | |
} |
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
@import 'over'; | |
a { | |
color: red; | |
@include over { | |
color: pink; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment