Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
Created April 5, 2015 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigmdennis/275deb829529874e86a0 to your computer and use it in GitHub Desktop.
Save craigmdennis/275deb829529874e86a0 to your computer and use it in GitHub Desktop.
Add hover events just for devices without touch capabilities
// .no-touch should be applied to the `html` or `body` elements with Modernizr or other script.
@mixin hover {
.no-touch & {
&:hover {
@content;
}
}
}
.panel {
background-color: red;
@include hover {
background-color: blue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment