Skip to content

Instantly share code, notes, and snippets.

@jcemer
Created May 26, 2012 16:59
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 jcemer/2794638 to your computer and use it in GitHub Desktop.
Save jcemer/2794638 to your computer and use it in GitHub Desktop.
LessCSS optional over background
.icon(@i, @over:true) {
background-position: 0 @i*-@iconHeight;
}
.icon(@i, @over:true) when (@over) {
&:hover {
background-position: -@iconWidth @i*-@iconHeight;
}
}
.class1 { .icon(2) }
.class2 { .icon(3, no-hover) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment