Skip to content

Instantly share code, notes, and snippets.

@cararemixed
Created January 5, 2011 21:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cararemixed/767085 to your computer and use it in GitHub Desktop.
Save cararemixed/767085 to your computer and use it in GitHub Desktop.
pattern matching specialization
@mixin some_sprite($state) {
background-image: url(...);
/* etc... */
}
@mixin some_sprite(default) {
background-position: 0px 18px;
}
@mixin some_sprite(hover) {
background-position: 18px 18px;
}
// somewhere down the line ..........
.thingy {
@include some_sprite(default);
}
.thingy:hover {
@include some_sprite(hover);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment