Skip to content

Instantly share code, notes, and snippets.

@lukephills
Created April 6, 2015 08:21
Show Gist options
  • Save lukephills/61b73454dad73182130e to your computer and use it in GitHub Desktop.
Save lukephills/61b73454dad73182130e to your computer and use it in GitHub Desktop.
Hover states - Quickly fix hover/normal states if you don’t need to style every state differently.
/**
* Normal States
*/
@mixin normal {
&:link,
&:visited {
@content;
}
}
/**
* Hover States
*/
@mixin hover {
&:hover,
&:focus,
&:active {
@content;
}
}
-----------USAGE-----------
.myclass {
background: red;
@include hover {
background: green;
text-decoration: none;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment